1# 2# This include file is used by more than one test suite 3# (currently rpl and binlog_encryption). 4# Please check all dependent tests after modifying it 5# 6 7--source include/have_debug.inc 8--source include/master-slave.inc 9 10SET @old_binlog_checksum=@@binlog_checksum; 11SET GLOBAL BINLOG_CHECKSUM=none; 12connection slave; 13SET @old_binlog_checksum=@@binlog_checksum; 14SET GLOBAL BINLOG_CHECKSUM=none; 15connection master; 16 17--echo **** On Master **** 18CREATE TABLE t1 (a INT); 19 20INSERT INTO t1 VALUES (1),(2),(3); 21SELECT * FROM t1; 22 23set @saved_dbug = @@global.debug_dbug; 24SET GLOBAL debug_dbug= '+d,incident_database_resync_on_replace,*'; 25 26# This will generate an incident log event and store it in the binary 27# log before the replace statement. 28REPLACE INTO t1 VALUES (4); 29--save_master_pos 30SELECT * FROM t1; 31 32set @@global.debug_dbug = @saved_dbug; 33 34connection slave; 35# Wait until SQL thread stops with error LOST_EVENT on master 36call mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occurred on the master.* 1590"); 37let $slave_sql_errno= 1590; 38let $show_slave_sql_error= 1; 39source include/wait_for_slave_sql_error.inc; 40 41# The 4 should not be inserted into the table, since the incident log 42# event should have stop the slave. 43--echo **** On Slave **** 44SELECT * FROM t1; 45 46SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; 47START SLAVE; 48--sync_with_master 49 50# Now, we should have inserted the row into the table and the slave 51# should be running. We should also have rotated to a new binary log. 52 53SELECT * FROM t1; 54source include/check_slave_is_running.inc; 55 56connection master; 57SET GLOBAL BINLOG_CHECKSUM=@old_binlog_checksum; 58DROP TABLE t1; 59--sync_slave_with_master 60SET GLOBAL BINLOG_CHECKSUM=@old_binlog_checksum; 61--source include/rpl_end.inc 62