1include/master-slave.inc
2Warnings:
3Note	####	Sending passwords in plain text without SSL/TLS is extremely insecure.
4Note	####	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.
5[connection master]
6CALL mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.');
7CALL mtr.add_suppression("Error dropping database");
8CALL mtr.add_suppression("Can't drop database '.*'; database doesn't exist");
9CALL mtr.add_suppression("Slave SQL for channel '': ... The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state. .* Error_code: 1756");
10==== Case 1: CALL is split on master ====
11---- Initialize ----
12CREATE TABLE t (a INT);
13CREATE PROCEDURE proc ()
14BEGIN
15INSERT INTO t VALUES (1);
16INSERT INTO t VALUES (2);
17END|
18---- GTID_NEXT=AUTOMATIC ----
19include/gtid_step_reset.inc
20CALL proc();
21include/gtid_step_assert.inc [count=2, only_count=0]
22include/assert.inc [Both rows were inserted]
23DELETE FROM t;
24---- GTID_NEXT=non-automatic ----
25include/gtid_step_reset.inc
26SET GTID_NEXT = '#';
27CALL proc();
28SET GTID_NEXT= 'AUTOMATIC';
29include/gtid_step_assert.inc [count=1, only_count=0]
30include/assert.inc [One row inserted if GTID_MODE=ON, two if GTID_MODE=OFF]
31DROP TABLE t;
32DROP PROCEDURE proc;
33==== Case 2A: DROP TABLE is split on master ====
34---- Initialize ----
35CREATE PROCEDURE create_tables()
36BEGIN
37CREATE TABLE base (a INT) ENGINE = InnoDB;
38CREATE TEMPORARY TABLE temp_t (a INT) ENGINE = InnoDB;
39CREATE TEMPORARY TABLE temp_n (a INT) ENGINE = MyISAM;
40END|
41CREATE PROCEDURE drop_tables()
42BEGIN
43DROP TABLE IF EXISTS base;
44DROP TABLE IF EXISTS temp_t;
45DROP TABLE IF EXISTS temp_n;
46END|
47include/rpl_sync.inc
48---- GTID_MODE=AUTOMATIC ----
49CALL create_tables();
50include/gtid_step_reset.inc
51DROP TABLE base, temp_t;
52include/gtid_step_assert.inc [count=2, only_count=0]
53include/assert_binlog_events.inc
54DROP TABLE temp_n;
55include/rpl_sync.inc
56include/rpl_reset.inc
57CALL create_tables();
58include/gtid_step_reset.inc
59DROP TABLE base, temp_n;
60include/gtid_step_assert.inc [count=2, only_count=0]
61include/assert_binlog_events.inc
62DROP TABLE temp_t;
63include/rpl_sync.inc
64include/rpl_reset.inc
65CALL create_tables();
66include/gtid_step_reset.inc
67DROP TABLE temp_t, temp_n;
68include/gtid_step_assert.inc [count=2, only_count=0]
69include/assert_binlog_events.inc
70DROP TABLE base;
71include/rpl_sync.inc
72include/rpl_reset.inc
73CALL create_tables();
74include/gtid_step_reset.inc
75DROP TABLE base, temp_t, temp_n;
76include/gtid_step_assert.inc [count=3, only_count=0]
77include/assert_binlog_events.inc
78include/rpl_sync.inc
79include/rpl_reset.inc
80---- GTID_MODE=non-automatic ----
81CALL create_tables();
82include/gtid_step_reset.inc
83SET GTID_NEXT = '#';
84DROP TABLE base, temp_t;
85SET GTID_NEXT = 'AUTOMATIC';
86include/gtid_step_assert.inc [count=2, only_count=0]
87include/assert_binlog_events.inc
88DROP TABLE temp_n;
89include/rpl_sync.inc
90include/rpl_reset.inc
91CALL create_tables();
92include/gtid_step_reset.inc
93SET GTID_NEXT = '#';
94DROP TABLE base, temp_n;
95SET GTID_NEXT = 'AUTOMATIC';
96include/gtid_step_assert.inc [count=2, only_count=0]
97include/assert_binlog_events.inc
98DROP TABLE temp_t;
99include/rpl_sync.inc
100include/rpl_reset.inc
101CALL create_tables();
102include/gtid_step_reset.inc
103SET GTID_NEXT = '#';
104DROP TABLE temp_t, temp_n;
105SET GTID_NEXT = 'AUTOMATIC';
106include/gtid_step_assert.inc [count=2, only_count=0]
107include/assert_binlog_events.inc
108DROP TABLE base;
109include/rpl_sync.inc
110include/rpl_reset.inc
111CALL create_tables();
112include/gtid_step_reset.inc
113SET GTID_NEXT = '#';
114DROP TABLE base, temp_t, temp_n;
115SET GTID_NEXT = 'AUTOMATIC';
116include/gtid_step_assert.inc [count=3, only_count=0]
117include/assert_binlog_events.inc
118include/rpl_sync.inc
119include/rpl_reset.inc
120==== Case 2B: DROP TABLE is split on slave ====
121---- Initialize ----
122CREATE TABLE dummy (a INT);
123DROP PROCEDURE create_tables;
124CREATE FUNCTION create_tables_func() RETURNS INT
125BEGIN
126IF @@GLOBAL.SERVER_ID = 2 THEN
127CREATE TEMPORARY TABLE temp_t (a INT) ENGINE = InnoDB;
128CREATE TEMPORARY TABLE temp_n (a INT) ENGINE = MyISAM;
129END IF;
130RETURN 0;
131END|
132CREATE PROCEDURE create_tables()
133BEGIN
134CREATE TABLE base (a INT);
135SET @@SESSION.SQL_LOG_BIN = 0;
136CREATE TABLE temp_t (a INT);
137CREATE TABLE temp_n (a INT);
138SET @@SESSION.SQL_LOG_BIN = 1;
139INSERT INTO dummy VALUES (create_tables_func());
140END|
141include/rpl_sync.inc
142---- GTID_MODE=AUTOMATIC ----
143CALL create_tables();
144Warnings:
145Note	1592	Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave.
146include/gtid_step_reset.inc
147DROP TABLE base, temp_t;
148include/gtid_step_assert.inc [count=1, only_count=0]
149include/assert_binlog_events.inc
150DROP TABLE temp_n;
151include/rpl_sync.inc
152include/rpl_reset.inc
153CALL create_tables();
154Warnings:
155Note	1592	Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave.
156include/gtid_step_reset.inc
157DROP TABLE base, temp_n;
158include/gtid_step_assert.inc [count=1, only_count=0]
159include/assert_binlog_events.inc
160DROP TABLE temp_t;
161include/rpl_sync.inc
162include/rpl_reset.inc
163CALL create_tables();
164Warnings:
165Note	1592	Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave.
166include/gtid_step_reset.inc
167DROP TABLE temp_t, temp_n;
168include/gtid_step_assert.inc [count=1, only_count=0]
169include/assert_binlog_events.inc
170DROP TABLE base;
171include/rpl_sync.inc
172include/rpl_reset.inc
173CALL create_tables();
174Warnings:
175Note	1592	Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave.
176include/gtid_step_reset.inc
177DROP TABLE base, temp_t, temp_n;
178include/gtid_step_assert.inc [count=1, only_count=0]
179include/assert_binlog_events.inc
180include/rpl_sync.inc
181include/rpl_reset.inc
182---- Clean up ----
183DROP FUNCTION create_tables_func;
184DROP PROCEDURE create_tables;
185DROP PROCEDURE drop_tables;
186DROP TABLE dummy;
187==== Case 3: DROP DATABASE ====
188---- Initialize ----
189# db1, db2, db3: no tables.
190CREATE DATABASE db1;
191CREATE DATABASE db2;
192CREATE DATABASE db3;
193include/rpl_sync.inc
194# db4, db5, db6: one table.
195CREATE DATABASE db4;
196CREATE DATABASE db5;
197CREATE DATABASE db6;
198CREATE TABLE db4.t1 (a INT);
199CREATE TABLE db5.t1 (a INT);
200CREATE TABLE db6.t1 (a INT);
201include/rpl_sync.inc
202# db7, db8, db9: many tables with long names.
203CREATE DATABASE db7;
204CREATE DATABASE db8;
205CREATE DATABASE db9;
206include/rpl_sync.inc
207# db10, db11, db12: not a database, but the directory exists.
208# db13, db14, db15: not a database. db15 is a database on master.
209include/rpl_sync.inc
210---- DROP DATABASE is split on master; GTID_NEXT=AUTOMATIC ----
211# db1: no table.
212include/save_binlog_position.inc
213SET GTID_NEXT = 'AUTOMATIC';
214DROP DATABASE db1;
215ERROR HY000: Error dropping database (can't rmdir './db1/', errno: 17)
216include/assert_binlog_events.inc
217# db4: one table.
218include/save_binlog_position.inc
219SET GTID_NEXT = 'AUTOMATIC';
220DROP DATABASE db4;
221ERROR HY000: Error dropping database (can't rmdir './db4/', errno: 17)
222include/assert_binlog_events.inc
223# db7: many tables with long names.
224include/save_binlog_position.inc
225SET GTID_NEXT = 'AUTOMATIC';
226DROP DATABASE db7;
227ERROR HY000: Error dropping database (can't rmdir './db7/', errno: 17)
228include/assert_binlog_events.inc
229# db10: not a database, but directory exists.
230include/save_binlog_position.inc
231SET GTID_NEXT = 'AUTOMATIC';
232DROP DATABASE db10;
233ERROR HY000: Error dropping database (can't rmdir './db10/', errno: 17)
234include/assert_binlog_events.inc
235# db13: not a database.
236include/save_binlog_position.inc
237SET GTID_NEXT = 'AUTOMATIC';
238DROP DATABASE db13;
239ERROR HY000: Can't drop database 'db13'; database doesn't exist
240include/assert_binlog_events.inc
241---- DROP DATABASE is split on master; GTID_NEXT=non-automatic ----
242# db2: no table.
243include/save_binlog_position.inc
244SET GTID_NEXT = '#';
245DROP DATABASE db2;
246ERROR HY000: Error dropping database (can't rmdir './db2/', errno: 17)
247include/assert_binlog_events.inc
248SET GTID_NEXT = 'AUTOMATIC';
249# db5: one table.
250include/save_binlog_position.inc
251SET GTID_NEXT = '#';
252DROP DATABASE db5;
253ERROR HY000: Error dropping database (can't rmdir './db5/', errno: 17)
254include/assert_binlog_events.inc
255SET GTID_NEXT = 'AUTOMATIC';
256# db8: many tables with long names.
257include/save_binlog_position.inc
258SET GTID_NEXT = '#';
259DROP DATABASE db8;
260ERROR HY000: Error dropping database (can't rmdir './db8/', errno: 17)
261include/assert_binlog_events.inc
262SET GTID_NEXT = 'AUTOMATIC';
263# db11: not a database, but directory exists.
264include/save_binlog_position.inc
265SET GTID_NEXT = '#';
266DROP DATABASE db11;
267ERROR HY000: Error dropping database (can't rmdir './db11/', errno: 17)
268include/assert_binlog_events.inc
269SET GTID_NEXT = 'AUTOMATIC';
270# db14: not a database.
271include/save_binlog_position.inc
272SET GTID_NEXT = '#';
273DROP DATABASE db14;
274ERROR HY000: Can't drop database 'db14'; database doesn't exist
275include/assert_binlog_events.inc
276SET GTID_NEXT = 'AUTOMATIC';
277---- DROP DATABASE is split on slave ----
278SET GTID_NEXT = 'AUTOMATIC';
279# db3: no table.
280DROP DATABASE db3;
281include/sync_slave_io_with_master.inc
282include/wait_for_slave_sql_error.inc [errno=1010]
283include/include/rpl_skip_to_end_of_relay_log.inc
284[connection master]
285# db6: one table.
286DROP DATABASE db6;
287include/sync_slave_io_with_master.inc
288include/wait_for_slave_sql_error.inc [errno=1010]
289include/include/rpl_skip_to_end_of_relay_log.inc
290[connection master]
291# db9: many tables with long names.
292DROP DATABASE db9;
293include/sync_slave_io_with_master.inc
294include/wait_for_slave_sql_error.inc [errno=1010]
295include/include/rpl_skip_to_end_of_relay_log.inc
296[connection master]
297# db12: not a database, but directory exists.
298DROP DATABASE db12;
299include/sync_slave_io_with_master.inc
300include/wait_for_slave_sql_error.inc [errno=1010]
301include/include/rpl_skip_to_end_of_relay_log.inc
302[connection master]
303# db15: not a database (on slave).
304DROP DATABASE db15;
305include/sync_slave_io_with_master.inc
306include/wait_for_slave_sql_error.inc [errno=1008]
307include/include/rpl_skip_to_end_of_relay_log.inc
308[connection master]
309---- Clean up ----
310DROP DATABASE db1;
311DROP DATABASE db2;
312DROP DATABASE IF EXISTS db3;
313Warnings:
314Note	1008	Can't drop database 'db3'; database doesn't exist
315DROP DATABASE db4;
316DROP DATABASE db5;
317DROP DATABASE IF EXISTS db6;
318Warnings:
319Note	1008	Can't drop database 'db6'; database doesn't exist
320DROP DATABASE db7;
321DROP DATABASE db8;
322DROP DATABASE IF EXISTS db9;
323Warnings:
324Note	1008	Can't drop database 'db9'; database doesn't exist
325DROP DATABASE IF EXISTS db10;
326DROP DATABASE IF EXISTS db11;
327DROP DATABASE IF EXISTS db12;
328Warnings:
329Note	1008	Can't drop database 'db12'; database doesn't exist
330DROP DATABASE IF EXISTS db15;
331Warnings:
332Note	1008	Can't drop database 'db15'; database doesn't exist
333include/rpl_sync.inc
334==== Case 4: CREATE TABLE ... SELECT ====
335See rpl_gtid_create_select.test
336include/rpl_end.inc
337