Debian Codegraph @

mysql-test/suite/ndb_rpl/t/rpl_truncate_7ndb.test

raw
1 --source include/have_ndb.inc
2 --source suite/ndb_rpl/ndb_master-slave.inc
3 --source include/have_binlog_format_mixed_or_row.inc
4
5 --disable_query_log
6 --disable_warnings
7 connection slave;
8 STOP SLAVE;
9 connection master;
10 DROP TABLE IF EXISTS t1;
11 RESET MASTER;
12 connection slave;
13 DROP TABLE IF EXISTS t1;
14 RESET SLAVE;
15 START SLAVE;
16 --enable_warnings
17 --enable_query_log
18
19 --echo **** On Master ****
20 connection master;
21 CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB;
22 INSERT INTO t1 VALUES (1,1), (2,2);
23 SELECT * FROM t1 ORDER BY a,b;
24 --echo **** On Slave ****
25 # This is silly, but NDB doesn't add to the binlog fast enough
26 --sleep 10
27 sync_slave_with_master;
28 INSERT INTO t1 VALUE (3,3);
29 SELECT * FROM t1 ORDER BY a,b;
30 --echo **** On Master ****
31 connection master;
32 TRUNCATE TABLE t1;
33 SELECT * FROM t1 ORDER BY a,b;
34 --echo **** On Slave ****
35 sync_slave_with_master;
36 # Should be empty
37 SELECT * FROM t1 ORDER BY a,b;
38 --echo **** On Master ****
39 connection master;
40 DROP TABLE t1;
41 source include/show_binlog_events.inc;
42
43 --echo **** On Master ****
44 connection master;
45 CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB;
46 INSERT INTO t1 VALUES (1,1), (2,2);
47 SELECT * FROM t1 ORDER BY a,b;
48 --echo **** On Slave ****
49 sync_slave_with_master;
50 INSERT INTO t1 VALUE (3,3);
51 SELECT * FROM t1 ORDER BY a,b;
52 --echo **** On Master ****
53 connection master;
54 DELETE FROM t1;
55 SELECT * FROM t1 ORDER BY a,b;
56 --echo **** On Slave ****
57 sync_slave_with_master;
58 # Should be empty
59 SELECT * FROM t1 ORDER BY a,b;
60 --echo **** On Master ****
61 connection master;
62 DROP TABLE t1;
63 source include/show_binlog_events.inc;
64
65 --source include/rpl_end.inc