1# 2# Start Multi-source replication, set up masters server_1 and server_3 3# with server_2 being a slave. 4# 5include/rpl_init.inc [topology=1->2,3->2] 6Warnings: 7Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. 8Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. 9Warnings: 10Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. 11Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. 12[connection server_2] 13include/stop_slave_sql.inc [FOR CHANNEL 'channel_1'] 14include/stop_slave_sql.inc [FOR CHANNEL 'channel_3'] 15# 16# Verify that SET @@global.binlog_format is allowed if none 17# of all replication channels have open temporary table(s). 18# 19SET @@global.binlog_format=ROW; 20# 21# Set binlog format to statement for replicating 22# CREATE TEMPORARY TABLE temp1 on server_1 23# 24SET @@global.binlog_format=STATEMENT; 25# 26# Start slave applier on channel_1, so that 27# SET @@global.binlog_format=STATEMENT takes 28# effect on channel_1. 29# 30include/start_slave_sql.inc [FOR CHANNEL 'channel_1'] 31connection_server_1 32# 33# Replicate the 'CREATE TEMPORARY TABLE temp1' to slave, so that 34# the slave channel_1 has an open temporary table. 35# 36CREATE TEMPORARY TABLE temp1(a INT); 37include/sync_slave_sql_with_master.inc [FOR CHANNEL 'channel_1'] 38[connection server_2] 39# 40# On a running slave, verify that SET @@global.binlog_format is 41# disallowed if any replication channel has open temporary table(s). 42# 43SET @@global.binlog_format=ROW; 44ERROR HY000: Changing @@global.binlog_format or @@persist.binlog_format is disallowed when any replication channel has open temporary table(s). You could wait until Slave_open_temp_tables = 0 and try again 45# 46# On a running slave, verify that SET @@persist.binlog_format is 47# disallowed if any replication channel has open temporary table(s). 48# 49SET @@persist.binlog_format=ROW; 50ERROR HY000: Changing @@global.binlog_format or @@persist.binlog_format is disallowed when any replication channel has open temporary table(s). You could wait until Slave_open_temp_tables = 0 and try again 51include/stop_slave.inc [FOR CHANNEL 'channel_1'] 52Warnings: 53Warning 3022 This operation may not be safe when the slave has temporary tables. The tables will be kept open until the server restarts or until the tables are deleted by any replicated DROP statement. Suggest to wait until slave_open_temp_tables = 0. 54# 55# On a stopped slave, verify that SET @@global.binlog_format is 56# disallowed if any replication channel has open temporary table(s). 57# 58SET @@global.binlog_format=ROW; 59ERROR HY000: Changing @@global.binlog_format or @@persist.binlog_format is disallowed when any replication channel has open temporary table(s). You could wait until Slave_open_temp_tables = 0 and try again 60# 61# On a stopped slave, verify that SET @@persist.binlog_format is 62# disallowed if any replication channel has open temporary table(s). 63# 64SET @@persist.binlog_format=ROW; 65ERROR HY000: Changing @@global.binlog_format or @@persist.binlog_format is disallowed when any replication channel has open temporary table(s). You could wait until Slave_open_temp_tables = 0 and try again 66include/start_slave.inc [FOR CHANNEL 'channel_1'] 67connection_server_1 68DROP TEMPORARY TABLE temp1; 69include/sync_slave_sql_with_master.inc [FOR CHANNEL 'channel_1'] 70include/rpl_end.inc 71RESET SLAVE ALL FOR CHANNEL 'channel_1'; 72RESET SLAVE ALL FOR CHANNEL 'channel_3'; 73