Debian Codegraph @

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

raw
1 --source include/have_innodb.inc
2 --source include/have_debug.inc
3 --source include/have_debug_sync.inc
4 --source include/have_binlog_format_row.inc
5
6 RESET MASTER;
7
8 CREATE TABLE t1 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Innodb;
9
10 # Test that
11 # 1. XA PREPARE is binlogged before the XA has been prepared in Engine
12 # 2. While XA PREPARE already binlogged in an old binlog file which has been rotated,
13 # Binlog checkpoint is not generated for the latest log until
14 # XA PREPARE returns, e.g OK to the client.
15
16
17 # con1 will hang before doing commit checkpoint, blocking RESET MASTER.
18 connect(con1,localhost,root,,);
19 SET DEBUG_SYNC= "at_unlog_xa_prepare SIGNAL con1_ready WAIT_FOR con1_go";
20 XA START '1';
21 INSERT INTO t1 SET a=1;
22 XA END '1';
23 --send XA PREPARE '1';
24
25
26 connection default;
27 SET DEBUG_SYNC= "now WAIT_FOR con1_ready";
28 FLUSH LOGS;
29 FLUSH LOGS;
30 FLUSH LOGS;
31
32 --source include/show_binary_logs.inc
33 --let $binlog_file= master-bin.000004
34 --let $binlog_start= 4
35 --source include/show_binlog_events.inc
36
37 SET DEBUG_SYNC= "now SIGNAL con1_go";
38
39 connection con1;
40 reap;
41 --echo *** master-bin.000004 checkpoint must show up now ***
42 --source include/wait_for_binlog_checkpoint.inc
43
44 # Todo: think about the error code returned, move to an appropriate test, or remove
45 # connection default;
46 #--error 1399
47 # DROP TABLE t1;
48
49 connection con1;
50 XA ROLLBACK '1';
51 SET debug_sync = 'reset';
52
53 # Clean up.
54 connection default;
55
56 DROP TABLE t1;
57 SET debug_sync = 'reset';