Debian Codegraph @

mysql-test/suite/binlog/t/binlog_atomic_ddl_rollback.test

raw
1 # ==== Purpose ====
2 #
3 # Prove a group of events is logged correctly including
4 # a terminal Query-log-event(COMMIT), despite a failing atomic DDL
5 # in front of the group generating query.
6 #
7 #
8 # ==== References ====
9 # BUG25755137 MASTER IS GENERATING INCOMPLETE TRX ON BINARY LOG (MISSING COMMIT)
10 #
11 --source include/have_debug_sync.inc
12 --source include/have_log_bin.inc
13 --source include/have_binlog_format_statement.inc
14
15 # In order to construct the deadlock error two tables and a view
16 # based on them are required.
17 CREATE TABLE t1 (a int);
18 CREATE TABLE t2 (a int);
19 CREATE VIEW v_12 AS SELECT t1.a AS a, t2.a AS b FROM t1,t2;
20
21 # The Commit-free group generator.
22 CREATE TEMPORARY TABLE tmp (a INT) ENGINE=innodb;
23
24 --connection default
25 SET DEBUG_SYNC= 'action_after_write_bin_log WAIT_FOR continue';
26 --send ALTER TABLE t2 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1
27
28 # Deadlock's 2nd participant
29 --connect (con1, localhost, root,,)
30 DROP TABLE t1,t2;
31 SET DEBUG_SYNC= 'now SIGNAL continue';
32
33 --connection default
34 --error ER_LOCK_DEADLOCK
35 --reap
36
37 #
38 # the group generator
39 #
40 --source include/save_binlog_position.inc
41 DELETE FROM tmp;
42
43 #
44 # Proof:
45 # the whole group of BEGIN; DELETE...; COMMIT must be present
46 #
47 --let $gtid_event=!Gtid_or_anon
48 --let $event_sequence= $gtid_event # !Begin # !Q(DELETE.*) # !Commit
49 --source include/assert_binlog_events.inc
50 --let $dont_print_pattern= 0
51
52 # Cleanup:
53
54 DROP VIEW v_12;
55