Debian Codegraph @

mysql-test/suite/s3/replication_delayed.test

raw
1 --source include/have_s3.inc
2 --source include/have_innodb.inc
3 --source include/have_binlog_format_mixed.inc
4 --source include/master-slave.inc
5 --source include/have_sequence.inc
6
7 # First clear the binlog
8 set binlog_format=mixed;
9 RESET MASTER;
10 connection slave;
11 set binlog_format=mixed;
12 RESET MASTER;
13 connection master;
14
15 #
16 # Create unique database for running the tests
17 #
18 --source create_database.inc
19 sync_slave_with_master;
20 --replace_result $database database
21 --eval use $database
22 connection master;
23
24 --echo #
25 --echo # MDEV-23691 S3 storage engine: delayed slave can drop the table
26 --echo #
27
28 connection slave;
29 stop slave;
30 connection master;
31
32 #
33 # Create version 1 of the table
34 #
35
36 create /*or replace*/ table t100 (
37 pk varchar(100)
38 ) engine = 'innodb';
39
40 insert into t100 values ('old data');
41 alter table t100 engine=s3;
42
43 #
44 # Create version 2 of the table
45 #
46 drop table t100;
47 create /*or replace*/ table t100 (
48 pk varchar(100)
49 ) engine= innodb;
50 insert into t100 select 'new data' from seq_1_to_10;
51 alter table t100 engine=s3;
52
53 select count(*), 'before slave start' from t100;
54
55 #
56 # Now, start the slave
57 #
58 connection slave;
59 start slave;
60 connection master;
61 sync_slave_with_master;
62 #select count(*) from t100;
63 connection master;
64
65 flush tables;
66 select count(*), 'after slave start' from t100;
67 show create table t100;
68
69 connection slave;
70
71 select count(*) from t100;
72
73 connection master;
74
75 drop table t100;
76
77 --echo #
78 --echo # Test delayed slave with inserts
79 --echo #
80
81
82 # Stop slave
83
84 connection slave;
85 stop slave;
86 connection master;
87
88 # Create tables with data while slave is stopped
89 create table t1 (a int) engine=innodb;
90 insert into t1 values (1),(2),(3);
91 insert into t1 select * from seq_4_to_6;
92 alter table t1 engine=s3;
93
94 connection slave;
95 start slave;
96 connection master;
97 sync_slave_with_master;
98 select * from t1;
99 connection master;
100 drop table t1;
101
102 --echo #
103 --echo # Check slave binary log
104 --echo #
105
106 sync_slave_with_master;
107 --let $binlog_database=$database
108 --source include/show_binlog_events.inc
109 connection master;
110
111 --echo #
112 --echo # clean up
113 --echo #
114 --source drop_database.inc
115 --source include/rpl_end.inc