Debian Codegraph @

mysql-test/suite/rpl_gtid/r/rpl_mts_spco_partition_commands_nobinlog.result

raw
1 include/master-slave.inc
2 Warnings:
3 Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
4 Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information.
5 [connection master]
6 [connection slave]
7 CALL mtr.add_suppression("You need to use --log-bin to make --binlog-format work");
8 CALL mtr.add_suppression("The transaction owned GTID is already in the gtid_executed table");
9 SET @save_replica_parallel_workers= @@global.replica_parallel_workers;
10 SET @save_replica_parallel_type= @@global.replica_parallel_type;
11 Warnings:
12 Warning 1287 '@@replica_parallel_type' is deprecated and will be removed in a future release.
13 SET @save_replica_preserve_commit_order= @@global.replica_preserve_commit_order;
14 SET GLOBAL replica_parallel_type = 'LOGICAL_CLOCK';
15 Warnings:
16 Warning 1287 '@@replica_parallel_type' is deprecated and will be removed in a future release.
17 SET GLOBAL replica_parallel_workers= 8;
18 SET GLOBAL replica_preserve_commit_order= ON;
19 include/start_slave.inc
20 [connection master1]
21 SET @save_binlog_transaction_dependency_tracking= @@global.binlog_transaction_dependency_tracking;
22 Warnings:
23 Warning 1287 '@@binlog_transaction_dependency_tracking' is deprecated and will be removed in a future release.
24 SET @@global.binlog_transaction_dependency_tracking = COMMIT_ORDER;
25 Warnings:
26 Warning 1287 '@@binlog_transaction_dependency_tracking' is deprecated and will be removed in a future release.
27 CREATE TABLE t_part (i INTEGER) PARTITION BY RANGE(i)
28 PARTITIONS 2 SUBPARTITION BY KEY(i) (
29 PARTITION p0 VALUES LESS THAN(100) (
30 SUBPARTITION sp00,
31 SUBPARTITION sp01),
32 PARTITION p1 VALUES LESS THAN(200) (
33 SUBPARTITION sp10,
34 SUBPARTITION sp11));
35 INSERT INTO t_part VALUES(1);
36 INSERT INTO t_part VALUES(101);
37 INSERT INTO t_part VALUES(199);
38 CREATE TABLE t_hash (a int, PRIMARY KEY (a)) ENGINE=InnoDB PARTITION BY HASH (a) PARTITIONS 2;
39 INSERT INTO t_hash VALUES(1);
40 INSERT INTO t_hash VALUES(101);
41 INSERT INTO t_hash VALUES(50);
42 CREATE TABLE t_part1 (i INTEGER) PARTITION BY RANGE(i)(
43 PARTITION p0 VALUES LESS THAN(100),
44 PARTITION p1 VALUES LESS THAN(200),
45 PARTITION p2 VALUES LESS THAN(300));
46
47 # Check for ALTER TABLE TRUNCATE PARTITION
48
49 # Setup
50
51 [connection master]
52 CREATE TABLE t1 (c1 INT PRIMARY KEY) ENGINE = InnoDB; CREATE TABLE t2 (c1 INT PRIMARY KEY) ENGINE = InnoDB;;
53 include/sync_slave_sql_with_master.inc
54
55 # Block slave sql applier threads
56
57 [connection slave]
58 BEGIN; INSERT INTO t1 VALUES (1);;
59 [connection slave]
60 [connection slave]
61
62 # Generate the transactions which can be applied in parallel on slave
63
64 [connection master]
65 # Adding debug point 'set_commit_parent_100' to @@GLOBAL.debug
66 BEGIN; INSERT INTO t1 VALUES (1); COMMIT; BEGIN; INSERT INTO t1 VALUES (2); COMMIT; ALTER TABLE t_part TRUNCATE PARTITION p0, p1;;
67 [connection server_1]
68 BEGIN; INSERT INTO t2 VALUES (1); COMMIT; BEGIN; INSERT INTO t2 VALUES (2); COMMIT; BEGIN; INSERT INTO t2 VALUES (3); COMMIT;;
69 # Removing debug point 'set_commit_parent_100' from @@GLOBAL.debug
70
71 # Verify the transactions are ordered correctly on slave
72
73 [connection server_2]
74 include/assert.inc [Verify table t1 is empty]
75 include/assert.inc [Verify table t2 is empty]
76 [connection slave]
77 include/assert.inc [Exactly 0 GTIDs should have been committed since last invocation]
78
79 # Rollback the first insert so that slave applier threads can
80 # unblock and proceed. Verify the transactions are applied.
81
82 [connection slave]
83 ROLLBACK;;
84 drop table t1; drop table t2;;
85 include/sync_slave_sql_with_master.inc
86 include/rpl_connect.inc [creating master]
87
88 # Check for ALTER TABLE DISCARD TABLESPACE
89 [connection master]
90 FLUSH TABLES t_hash FOR EXPORT;
91 # Copying the .cfg and .ibd files as backup
92 UNLOCK TABLES;
93 [connection slave]
94 FLUSH TABLES t_hash FOR EXPORT;
95 # Copying the .cfg and .ibd files as backup
96 UNLOCK TABLES;
97
98 # Setup
99
100 [connection master]
101 CREATE TABLE t1 (c1 INT PRIMARY KEY) ENGINE = InnoDB; CREATE TABLE t2 (c1 INT PRIMARY KEY) ENGINE = InnoDB;;
102 include/sync_slave_sql_with_master.inc
103
104 # Block slave sql applier threads
105
106 [connection slave]
107 BEGIN; INSERT INTO t1 VALUES (1);;
108 [connection slave]
109 [connection slave]
110
111 # Generate the transactions which can be applied in parallel on slave
112
113 [connection master]
114 # Adding debug point 'set_commit_parent_100' to @@GLOBAL.debug
115 BEGIN; INSERT INTO t1 VALUES (1); COMMIT; BEGIN; INSERT INTO t1 VALUES (2); COMMIT; ALTER TABLE t_hash DISCARD TABLESPACE;;
116 [connection server_1]
117 BEGIN; INSERT INTO t2 VALUES (1); COMMIT; BEGIN; INSERT INTO t2 VALUES (2); COMMIT; BEGIN; INSERT INTO t2 VALUES (3); COMMIT;;
118 # Removing debug point 'set_commit_parent_100' from @@GLOBAL.debug
119
120 # Verify the transactions are ordered correctly on slave
121
122 [connection server_2]
123 include/assert.inc [Verify table t1 is empty]
124 include/assert.inc [Verify table t2 is empty]
125 [connection slave]
126 include/assert.inc [Exactly 0 GTIDs should have been committed since last invocation]
127
128 # Rollback the first insert so that slave applier threads can
129 # unblock and proceed. Verify the transactions are applied.
130
131 [connection slave]
132 ROLLBACK;;
133 drop table t1; drop table t2;;
134 include/sync_slave_sql_with_master.inc
135 include/rpl_connect.inc [creating master]
136
137 # Check for ALTER TABLE IMPORT TABLESPACE
138 [connection master]
139 # Moving the .cfg and .ibd files back from backup on master
140 [connection slave]
141 # Moving the .cfg and .ibd files back from backup on slave
142
143 # Setup
144
145 [connection master]
146 CREATE TABLE t1 (c1 INT PRIMARY KEY) ENGINE = InnoDB; CREATE TABLE t2 (c1 INT PRIMARY KEY) ENGINE = InnoDB;;
147 include/sync_slave_sql_with_master.inc
148
149 # Block slave sql applier threads
150
151 [connection slave]
152 BEGIN; INSERT INTO t1 VALUES (1);;
153 [connection slave]
154 [connection slave]
155
156 # Generate the transactions which can be applied in parallel on slave
157
158 [connection master]
159 # Adding debug point 'set_commit_parent_100' to @@GLOBAL.debug
160 BEGIN; INSERT INTO t1 VALUES (1); COMMIT; BEGIN; INSERT INTO t1 VALUES (2); COMMIT; ALTER TABLE t_hash IMPORT TABLESPACE;;
161 [connection server_1]
162 BEGIN; INSERT INTO t2 VALUES (1); COMMIT; BEGIN; INSERT INTO t2 VALUES (2); COMMIT; BEGIN; INSERT INTO t2 VALUES (3); COMMIT;;
163 # Removing debug point 'set_commit_parent_100' from @@GLOBAL.debug
164
165 # Verify the transactions are ordered correctly on slave
166
167 [connection server_2]
168 include/assert.inc [Verify table t1 is empty]
169 include/assert.inc [Verify table t2 is empty]
170 [connection slave]
171 include/assert.inc [Exactly 0 GTIDs should have been committed since last invocation]
172
173 # Rollback the first insert so that slave applier threads can
174 # unblock and proceed. Verify the transactions are applied.
175
176 [connection slave]
177 ROLLBACK;;
178 drop table t1; drop table t2;;
179 include/sync_slave_sql_with_master.inc
180 include/rpl_connect.inc [creating master]
181
182 # Check for ALTER TABLE COALESCE PARTITION
183
184 # Setup
185
186 [connection master]
187 CREATE TABLE t1 (c1 INT PRIMARY KEY) ENGINE = InnoDB; CREATE TABLE t2 (c1 INT PRIMARY KEY) ENGINE = InnoDB;;
188 include/sync_slave_sql_with_master.inc
189
190 # Block slave sql applier threads
191
192 [connection slave]
193 BEGIN; INSERT INTO t1 VALUES (1);;
194 [connection slave]
195 [connection slave]
196
197 # Generate the transactions which can be applied in parallel on slave
198
199 [connection master]
200 # Adding debug point 'set_commit_parent_100' to @@GLOBAL.debug
201 BEGIN; INSERT INTO t1 VALUES (1); COMMIT; BEGIN; INSERT INTO t1 VALUES (2); COMMIT; ALTER TABLE t_hash COALESCE PARTITION 1;;
202 [connection server_1]
203 BEGIN; INSERT INTO t2 VALUES (1); COMMIT; BEGIN; INSERT INTO t2 VALUES (2); COMMIT; BEGIN; INSERT INTO t2 VALUES (3); COMMIT;;
204 # Removing debug point 'set_commit_parent_100' from @@GLOBAL.debug
205
206 # Verify the transactions are ordered correctly on slave
207
208 [connection server_2]
209 include/assert.inc [Verify table t1 has one value]
210 include/assert.inc [Verify table t2 is empty]
211 include/assert.inc [Verify both partitions exist]
212 [connection slave]
213 include/assert.inc [Exactly 0 GTIDs should have been committed since last invocation]
214
215 # Rollback the first insert so that slave applier threads can
216 # unblock and proceed. Verify the transactions are applied.
217
218 [connection slave]
219 ROLLBACK;;
220 drop table t1; drop table t2;;
221 include/sync_slave_sql_with_master.inc
222
223 # Check for ALTER TABLE ANALYZE PARTITION
224
225 # Setup
226
227 [connection master]
228 CREATE TABLE t1 (c1 INT PRIMARY KEY) ENGINE = InnoDB; CREATE TABLE t2 (c1 INT PRIMARY KEY) ENGINE = InnoDB;;
229 include/sync_slave_sql_with_master.inc
230
231 # Block slave sql applier threads
232
233 [connection slave]
234 BEGIN; INSERT INTO t1 VALUES (1);;
235 [connection slave]
236 [connection slave]
237
238 # Generate the transactions which can be applied in parallel on slave
239
240 [connection master]
241 # Adding debug point 'set_commit_parent_100' to @@GLOBAL.debug
242 BEGIN; INSERT INTO t1 VALUES (1); COMMIT; BEGIN; INSERT INTO t1 VALUES (2); COMMIT; ALTER TABLE t_part ANALYZE PARTITION p0;;
243 Table Op Msg_type Msg_text
244 test.t_part analyze status OK
245 [connection server_1]
246 BEGIN; INSERT INTO t2 VALUES (1); COMMIT; BEGIN; INSERT INTO t2 VALUES (2); COMMIT; BEGIN; INSERT INTO t2 VALUES (3); COMMIT;;
247 # Removing debug point 'set_commit_parent_100' from @@GLOBAL.debug
248
249 # Verify the transactions are ordered correctly on slave
250
251 [connection server_2]
252 include/assert.inc [Verify table t1 is empty]
253 include/assert.inc [Verify table t2 is empty]
254 [connection slave]
255 include/assert.inc [Exactly 0 GTIDs should have been committed since last invocation]
256
257 # Rollback the first insert so that slave applier threads can
258 # unblock and proceed. Verify the transactions are applied.
259
260 [connection slave]
261 ROLLBACK;;
262 drop table t1; drop table t2;;
263 include/sync_slave_sql_with_master.inc
264 include/rpl_connect.inc [creating master]
265
266 # Check for ALTER TABLE OPTIMIZE PARTITION
267
268 # Setup
269
270 [connection master]
271 CREATE TABLE t1 (c1 INT PRIMARY KEY) ENGINE = InnoDB; CREATE TABLE t2 (c1 INT PRIMARY KEY) ENGINE = InnoDB;;
272 include/sync_slave_sql_with_master.inc
273
274 # Block slave sql applier threads
275
276 [connection slave]
277 BEGIN; INSERT INTO t1 VALUES (1);;
278 [connection slave]
279 [connection slave]
280
281 # Generate the transactions which can be applied in parallel on slave
282
283 [connection master]
284 # Adding debug point 'set_commit_parent_100' to @@GLOBAL.debug
285 BEGIN; INSERT INTO t1 VALUES (1); COMMIT; BEGIN; INSERT INTO t1 VALUES (2); COMMIT; ALTER TABLE t_part OPTIMIZE PARTITION p0, p1;;
286 Table Op Msg_type Msg_text
287 test.t_part optimize note Table does not support optimize on partitions. All partitions will be rebuilt and analyzed.
288 test.t_part optimize status OK
289 [connection server_1]
290 BEGIN; INSERT INTO t2 VALUES (1); COMMIT; BEGIN; INSERT INTO t2 VALUES (2); COMMIT; BEGIN; INSERT INTO t2 VALUES (3); COMMIT;;
291 # Removing debug point 'set_commit_parent_100' from @@GLOBAL.debug
292
293 # Verify the transactions are ordered correctly on slave
294
295 [connection server_2]
296 include/assert.inc [Verify table t1 is empty]
297 include/assert.inc [Verify table t2 is empty]
298 [connection slave]
299 include/assert.inc [Exactly 0 GTIDs should have been committed since last invocation]
300
301 # Rollback the first insert so that slave applier threads can
302 # unblock and proceed. Verify the transactions are applied.
303
304 [connection slave]
305 ROLLBACK;;
306 drop table t1; drop table t2;;
307 include/sync_slave_sql_with_master.inc
308 include/rpl_connect.inc [creating master]
309
310 # Check for ALTER TABLE REPAIR PARTITION
311
312 # Setup
313
314 [connection master]
315 CREATE TABLE t1 (c1 INT PRIMARY KEY) ENGINE = InnoDB; CREATE TABLE t2 (c1 INT PRIMARY KEY) ENGINE = InnoDB;;
316 include/sync_slave_sql_with_master.inc
317
318 # Block slave sql applier threads
319
320 [connection slave]
321 BEGIN; INSERT INTO t1 VALUES (1);;
322 [connection slave]
323 [connection slave]
324
325 # Generate the transactions which can be applied in parallel on slave
326
327 [connection master]
328 # Adding debug point 'set_commit_parent_100' to @@GLOBAL.debug
329 BEGIN; INSERT INTO t1 VALUES (1); COMMIT; BEGIN; INSERT INTO t1 VALUES (2); COMMIT; ALTER TABLE t_part REPAIR PARTITION p0, p1;;
330 Table Op Msg_type Msg_text
331 test.t_part repair status OK
332 [connection server_1]
333 BEGIN; INSERT INTO t2 VALUES (1); COMMIT; BEGIN; INSERT INTO t2 VALUES (2); COMMIT; BEGIN; INSERT INTO t2 VALUES (3); COMMIT;;
334 # Removing debug point 'set_commit_parent_100' from @@GLOBAL.debug
335
336 # Verify the transactions are ordered correctly on slave
337
338 [connection server_2]
339 include/assert.inc [Verify table t1 is empty]
340 include/assert.inc [Verify table t2 is empty]
341 [connection slave]
342 include/assert.inc [Exactly 0 GTIDs should have been committed since last invocation]
343
344 # Rollback the first insert so that slave applier threads can
345 # unblock and proceed. Verify the transactions are applied.
346
347 [connection slave]
348 ROLLBACK;;
349 drop table t1; drop table t2; truncate table t_part;;
350 include/sync_slave_sql_with_master.inc
351 include/rpl_connect.inc [creating master]
352
353 # Check for ALTER TABLE REMOVE PARTITIONING
354
355 # Setup
356
357 [connection master]
358 CREATE TABLE t1 (c1 INT PRIMARY KEY) ENGINE = InnoDB; CREATE TABLE t2 (c1 INT PRIMARY KEY) ENGINE = InnoDB; CREATE TABLE t_nopart1 LIKE t_part;;
359 include/sync_slave_sql_with_master.inc
360
361 # Block slave sql applier threads
362
363 [connection slave]
364 BEGIN; INSERT INTO t1 VALUES (1);;
365 [connection slave]
366 [connection slave]
367
368 # Generate the transactions which can be applied in parallel on slave
369
370 [connection master]
371 # Adding debug point 'set_commit_parent_100' to @@GLOBAL.debug
372 BEGIN; INSERT INTO t1 VALUES (1); COMMIT; BEGIN; INSERT INTO t1 VALUES (2); COMMIT; ALTER TABLE t_nopart1 REMOVE PARTITIONING;;
373 [connection server_1]
374 BEGIN; INSERT INTO t2 VALUES (1); COMMIT; BEGIN; INSERT INTO t2 VALUES (2); COMMIT; BEGIN; INSERT INTO t2 VALUES (3); COMMIT;;
375 # Removing debug point 'set_commit_parent_100' from @@GLOBAL.debug
376
377 # Verify the transactions are ordered correctly on slave
378
379 [connection server_2]
380 include/assert.inc [Verify table t1 is empty]
381 include/assert.inc [Verify table t2 is empty]
382 include/assert.inc [Verify all partitions exist]
383 [connection slave]
384 include/assert.inc [Exactly 0 GTIDs should have been committed since last invocation]
385
386 # Rollback the first insert so that slave applier threads can
387 # unblock and proceed. Verify the transactions are applied.
388
389 [connection slave]
390 ROLLBACK;;
391 drop table t1; drop table t2; DROP TABLE t_nopart1;;
392 include/sync_slave_sql_with_master.inc
393
394 # Check for ALTER TABLE EXCHANGE PARTITION
395
396 # Setup
397
398 [connection master]
399 CREATE TABLE t1 (c1 INT PRIMARY KEY) ENGINE = InnoDB; CREATE TABLE t2 (c1 INT PRIMARY KEY) ENGINE = InnoDB; INSERT INTO t_part VALUES(1),(2),(101),(102),(199); CREATE TABLE t_nopart1 LIKE t_part; ALTER TABLE t_nopart1 REMOVE PARTITIONING;;
400 include/sync_slave_sql_with_master.inc
401
402 # Block slave sql applier threads
403
404 [connection slave]
405 BEGIN; INSERT INTO t1 VALUES (1);;
406 [connection slave]
407 [connection slave]
408
409 # Generate the transactions which can be applied in parallel on slave
410
411 [connection master]
412 # Adding debug point 'set_commit_parent_100' to @@GLOBAL.debug
413 BEGIN; INSERT INTO t1 VALUES (1); COMMIT; BEGIN; INSERT INTO t1 VALUES (2); COMMIT; ALTER TABLE t_part EXCHANGE PARTITION sp00 WITH TABLE t_nopart1;;
414 [connection server_1]
415 BEGIN; INSERT INTO t2 VALUES (1); COMMIT; BEGIN; INSERT INTO t2 VALUES (2); COMMIT; BEGIN; INSERT INTO t2 VALUES (3); COMMIT;;
416 # Removing debug point 'set_commit_parent_100' from @@GLOBAL.debug
417
418 # Verify the transactions are ordered correctly on slave
419
420 [connection server_2]
421 include/assert.inc [Verify table t1 is empty]
422 include/assert.inc [Verify table t2 is empty]
423 [connection slave]
424 include/assert.inc [Exactly 0 GTIDs should have been committed since last invocation]
425
426 # Rollback the first insert so that slave applier threads can
427 # unblock and proceed. Verify the transactions are applied.
428
429 [connection slave]
430 ROLLBACK;;
431 drop table t1; drop table t2; DROP TABLE t_nopart1;;
432 include/sync_slave_sql_with_master.inc
433 include/rpl_connect.inc [creating master]
434
435 # Check for ALTER TABLE REBUILD PARTITON
436
437 # Setup
438
439 [connection master]
440 CREATE TABLE t1 (c1 INT PRIMARY KEY) ENGINE = InnoDB; CREATE TABLE t2 (c1 INT PRIMARY KEY) ENGINE = InnoDB; CREATE TABLE t_nopart2 LIKE t_part; ALTER TABLE t_nopart2 REMOVE PARTITIONING; INSERT INTO t_nopart2 VALUES(1000); INSERT INTO t_nopart2 VALUES(1); ALTER TABLE t_part EXCHANGE PARTITION sp01 WITH TABLE t_nopart2 WITHOUT VALIDATION;;
441 include/sync_slave_sql_with_master.inc
442
443 # Block slave sql applier threads
444
445 [connection slave]
446 BEGIN; INSERT INTO t1 VALUES (1);;
447 [connection slave]
448 [connection slave]
449
450 # Generate the transactions which can be applied in parallel on slave
451
452 [connection master]
453 # Adding debug point 'set_commit_parent_100' to @@GLOBAL.debug
454 BEGIN; INSERT INTO t1 VALUES (1); COMMIT; BEGIN; INSERT INTO t1 VALUES (2); COMMIT; ALTER TABLE t_part REBUILD PARTITION p0;;
455 [connection server_1]
456 BEGIN; INSERT INTO t2 VALUES (1); COMMIT; BEGIN; INSERT INTO t2 VALUES (2); COMMIT; BEGIN; INSERT INTO t2 VALUES (3); COMMIT;;
457 # Removing debug point 'set_commit_parent_100' from @@GLOBAL.debug
458
459 # Verify the transactions are ordered correctly on slave
460
461 [connection server_2]
462 include/assert.inc [Verify table t1 is empty]
463 include/assert.inc [Verify table t2 is empty]
464 [connection slave]
465 include/assert.inc [Exactly 0 GTIDs should have been committed since last invocation]
466
467 # Rollback the first insert so that slave applier threads can
468 # unblock and proceed. Verify the transactions are applied.
469
470 [connection slave]
471 ROLLBACK;;
472 drop table t1; drop table t2;;
473 include/sync_slave_sql_with_master.inc
474 include/rpl_connect.inc [creating master]
475
476 # Check for ALTER TABLE REORGANIZE PARTITION
477
478 # Setup
479
480 [connection master]
481 CREATE TABLE t1 (c1 INT PRIMARY KEY) ENGINE = InnoDB; CREATE TABLE t2 (c1 INT PRIMARY KEY) ENGINE = InnoDB;;
482 include/sync_slave_sql_with_master.inc
483
484 # Block slave sql applier threads
485
486 [connection slave]
487 BEGIN; INSERT INTO t1 VALUES (1);;
488 [connection slave]
489 [connection slave]
490
491 # Generate the transactions which can be applied in parallel on slave
492
493 [connection master]
494 # Adding debug point 'set_commit_parent_100' to @@GLOBAL.debug
495 BEGIN; INSERT INTO t1 VALUES (1); COMMIT; BEGIN; INSERT INTO t1 VALUES (2); COMMIT;ALTER TABLE t_part1 REORGANIZE PARTITION p1,p2 INTO (PARTITION p3 VALUES LESS THAN (300));;
496 [connection server_1]
497 BEGIN; INSERT INTO t2 VALUES (1); COMMIT; BEGIN; INSERT INTO t2 VALUES (2); COMMIT; BEGIN; INSERT INTO t2 VALUES (3); COMMIT;;
498 # Removing debug point 'set_commit_parent_100' from @@GLOBAL.debug
499
500 # Verify the transactions are ordered correctly on slave
501
502 [connection server_2]
503 include/assert.inc [Verify table t1 is empty]
504 include/assert.inc [Verify table t2 is empty]
505 include/assert.inc [Verify Partition p3 doesnot exist]
506 [connection slave]
507 include/assert.inc [Exactly 0 GTIDs should have been committed since last invocation]
508
509 # Rollback the first insert so that slave applier threads can
510 # unblock and proceed. Verify the transactions are applied.
511
512 [connection slave]
513 ROLLBACK;;
514 drop table t1; drop table t2;;
515 include/sync_slave_sql_with_master.inc
516
517 # Check for ALTER TABLE ADD PARTITION
518
519 # Setup
520
521 [connection master]
522 CREATE TABLE t1 (c1 INT PRIMARY KEY) ENGINE = InnoDB; CREATE TABLE t2 (c1 INT PRIMARY KEY) ENGINE = InnoDB;;
523 include/sync_slave_sql_with_master.inc
524
525 # Block slave sql applier threads
526
527 [connection slave]
528 BEGIN; INSERT INTO t1 VALUES (1);;
529 [connection slave]
530 [connection slave]
531
532 # Generate the transactions which can be applied in parallel on slave
533
534 [connection master]
535 # Adding debug point 'set_commit_parent_100' to @@GLOBAL.debug
536 BEGIN; INSERT INTO t1 VALUES (1); COMMIT; BEGIN; INSERT INTO t1 VALUES (2); COMMIT; ALTER TABLE t_part ADD PARTITION (PARTITION p3 VALUES LESS THAN (300));;
537 [connection server_1]
538 BEGIN; INSERT INTO t2 VALUES (1); COMMIT; BEGIN; INSERT INTO t2 VALUES (2); COMMIT; BEGIN; INSERT INTO t2 VALUES (3); COMMIT;;
539 # Removing debug point 'set_commit_parent_100' from @@GLOBAL.debug
540
541 # Verify the transactions are ordered correctly on slave
542
543 [connection server_2]
544 include/assert.inc [Verify table t1 is empty]
545 include/assert.inc [Verify table t2 is empty]
546 include/assert.inc [Verify Partition p3 doesnot exist]
547 [connection slave]
548 include/assert.inc [Exactly 0 GTIDs should have been committed since last invocation]
549
550 # Rollback the first insert so that slave applier threads can
551 # unblock and proceed. Verify the transactions are applied.
552
553 [connection slave]
554 ROLLBACK;;
555 drop table t1; drop table t2;;
556 include/sync_slave_sql_with_master.inc
557
558 # Check for ALTER TABLE DROP PARTITION
559
560 # Setup
561
562 [connection master]
563 CREATE TABLE t1 (c1 INT PRIMARY KEY) ENGINE = InnoDB; CREATE TABLE t2 (c1 INT PRIMARY KEY) ENGINE = InnoDB;;
564 include/sync_slave_sql_with_master.inc
565
566 # Block slave sql applier threads
567
568 [connection slave]
569 BEGIN; INSERT INTO t1 VALUES (1);;
570 [connection slave]
571 [connection slave]
572
573 # Generate the transactions which can be applied in parallel on slave
574
575 [connection master]
576 # Adding debug point 'set_commit_parent_100' to @@GLOBAL.debug
577 BEGIN; INSERT INTO t1 VALUES (1); COMMIT; BEGIN; INSERT INTO t1 VALUES (2); COMMIT; ALTER TABLE t_part DROP PARTITION p3;;
578 [connection server_1]
579 BEGIN; INSERT INTO t2 VALUES (1); COMMIT; BEGIN; INSERT INTO t2 VALUES (2); COMMIT; BEGIN; INSERT INTO t2 VALUES (3); COMMIT;;
580 # Removing debug point 'set_commit_parent_100' from @@GLOBAL.debug
581
582 # Verify the transactions are ordered correctly on slave
583
584 [connection server_2]
585 include/assert.inc [Verify table t1 is empty]
586 include/assert.inc [Verify table t2 is empty]
587 include/assert.inc [Verify Partition p3 exist]
588 [connection slave]
589 include/assert.inc [Exactly 0 GTIDs should have been committed since last invocation]
590
591 # Rollback the first insert so that slave applier threads can
592 # unblock and proceed. Verify the transactions are applied.
593
594 [connection slave]
595 ROLLBACK;;
596 DROP TABLE t1,t2,t_hash,t_part,t_part1,t_nopart2;;
597 include/sync_slave_sql_with_master.inc
598
599 # Cleanup
600
601 [connection master1]
602 SET GLOBAL binlog_transaction_dependency_tracking=@save_binlog_transaction_dependency_tracking;
603 Warnings:
604 Warning 1287 '@@binlog_transaction_dependency_tracking' is deprecated and will be removed in a future release.
605 include/sync_slave_sql_with_master.inc
606 include/stop_slave.inc
607 SET GLOBAL replica_parallel_type=@save_replica_parallel_type;
608 Warnings:
609 Warning 1287 '@@replica_parallel_type' is deprecated and will be removed in a future release.
610 SET GLOBAL replica_parallel_workers=@save_replica_parallel_workers;
611 SET GLOBAL replica_preserve_commit_order=@save_replica_preserve_commit_order;
612 include/start_slave.inc
613 include/rpl_end.inc