File: binlog_xid_xa_nullbyte.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (71 lines) | stat: -rw-r--r-- 1,810 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
###############################################################################
# === Purpose ===
#
# The purpose of this test is to recover XA transactions with XIDs containing null bytes.
#
# === Requirements ===
#
# A binary log containing 2 XA PREPARE transactions in sequence with different XIDs containing null
# bytes does not fail on recovery.
#
# === Implementation ===
#
#  1) Configuration
#  2) Create a table and  prepare 2 XA transactions
#  3) Restart the server
#  4) Rollback the transaction to remove XID from prepared state.
#  5) Cleanup
#
# === Reference ===
#
# Bug#34918985 : Can't recover XA transactions with XIDs containing null bytes
#
###############################################################################

--source include/have_log_bin.inc
--source include/have_binlog_format_row.inc
--let $rpl_extra_connections_per_server= 1
--let $rpl_topology= none
--let $rpl_server_count= 1
--source include/rpl_init.inc
--echo #
--echo # 1) Configuration
--echo #
--let $messages=Found 2 prepared XA transactions
--source include/suppress_messages.inc

--let $xid1=X'0011'
--let $xid2=X'0022'

--echo #
--echo # 2) Create a table and prepare 2 XA transactions
--echo #
CREATE TABLE t (a INT);
eval XA START $xid1;
INSERT INTO t VALUES (1);
eval XA END $xid1;
eval XA PREPARE $xid1;
eval XA START $xid2;
INSERT INTO t VALUES (2);
eval XA END $xid2;
eval XA PREPARE $xid2;

--echo #
--echo # 3) Restart the server
--echo #
--let $rpl_server_number = 1
--let $rpl_force_stop = 1
#Test requirement is validated when rpl_restart_server.inc does not fail
--source include/rpl_restart_server.inc

--echo #
--echo # 4) Rollback the transaction to remove XID from prepared state.
--echo #
eval XA rollback $xid1;
eval XA rollback $xid2;

--echo #
--echo # 5) Cleanup
--echo #
DROP TABLE t;