Debian Codegraph @

mysql-test/suite/rpl/t/rpl_incident.test

raw
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
10 SET @old_binlog_checksum=@@binlog_checksum;
11 SET GLOBAL BINLOG_CHECKSUM=none;
12 connection slave;
13 SET @old_binlog_checksum=@@binlog_checksum;
14 SET GLOBAL BINLOG_CHECKSUM=none;
15 connection master;
16
17 --echo **** On Master ****
18 CREATE TABLE t1 (a INT);
19
20 INSERT INTO t1 VALUES (1),(2),(3);
21 SELECT * FROM t1;
22
23 set @saved_dbug = @@global.debug_dbug;
24 SET 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.
28 REPLACE INTO t1 VALUES (4);
29 --save_master_pos
30 SELECT * FROM t1;
31
32 set @@global.debug_dbug = @saved_dbug;
33
34 connection slave;
35 # Wait until SQL thread stops with error LOST_EVENT on master
36 call mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occurred on the master.* 1590");
37 let $slave_sql_errno= 1590;
38 let $show_slave_sql_error= 1;
39 source 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 ****
44 SELECT * FROM t1;
45
46 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
47 START 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
53 SELECT * FROM t1;
54 source include/check_slave_is_running.inc;
55
56 connection master;
57 SET GLOBAL BINLOG_CHECKSUM=@old_binlog_checksum;
58 DROP TABLE t1;
59 --sync_slave_with_master
60 SET GLOBAL BINLOG_CHECKSUM=@old_binlog_checksum;
61 --source include/rpl_end.inc