Debian Codegraph @

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

raw
1 ###############################################################################
2 # === Purpose ===
3 #
4 # The purpose of this test is to recover XA transactions with XIDs containing null bytes.
5 #
6 # === Requirements ===
7 #
8 # A binary log containing 2 XA PREPARE transactions in sequence with different XIDs containing null
9 # bytes does not fail on recovery.
10 #
11 # === Implementation ===
12 #
13 # 1) Configuration
14 # 2) Create a table and prepare 2 XA transactions
15 # 3) Restart the server
16 # 4) Rollback the transaction to remove XID from prepared state.
17 # 5) Cleanup
18 #
19 # === Reference ===
20 #
21 # Bug#34918985 : Can't recover XA transactions with XIDs containing null bytes
22 #
23 ###############################################################################
24
25 --source include/have_log_bin.inc
26 --source include/have_binlog_format_row.inc
27 --let $rpl_extra_connections_per_server= 1
28 --let $rpl_topology= none
29 --let $rpl_server_count= 1
30 --source include/rpl_init.inc
31 --echo #
32 --echo # 1) Configuration
33 --echo #
34 --let $messages=Found 2 prepared XA transactions
35 --source include/suppress_messages.inc
36
37 --let $xid1=X'0011'
38 --let $xid2=X'0022'
39
40 --echo #
41 --echo # 2) Create a table and prepare 2 XA transactions
42 --echo #
43 CREATE TABLE t (a INT);
44 eval XA START $xid1;
45 INSERT INTO t VALUES (1);
46 eval XA END $xid1;
47 eval XA PREPARE $xid1;
48 eval XA START $xid2;
49 INSERT INTO t VALUES (2);
50 eval XA END $xid2;
51 eval XA PREPARE $xid2;
52
53 --echo #
54 --echo # 3) Restart the server
55 --echo #
56 --let $rpl_server_number = 1
57 --let $rpl_force_stop = 1
58 #Test requirement is validated when rpl_restart_server.inc does not fail
59 --source include/rpl_restart_server.inc
60
61 --echo #
62 --echo # 4) Rollback the transaction to remove XID from prepared state.
63 --echo #
64 eval XA rollback $xid1;
65 eval XA rollback $xid2;
66
67 --echo #
68 --echo # 5) Cleanup
69 --echo #
70 DROP TABLE t;
71