File: binlog_xa_checkpoint.test

package info (click to toggle)
mariadb 1%3A11.8.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 765,428 kB
  • sloc: ansic: 2,382,827; cpp: 1,803,532; asm: 378,315; perl: 63,176; sh: 46,496; pascal: 40,776; java: 39,363; yacc: 20,428; python: 19,506; sql: 17,864; xml: 12,463; ruby: 8,544; makefile: 6,059; cs: 5,855; ada: 1,700; lex: 1,193; javascript: 1,039; objc: 80; tcl: 73; awk: 46; php: 22
file content (57 lines) | stat: -rw-r--r-- 1,449 bytes parent folder | download | duplicates (5)
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
--source include/have_innodb.inc
--source include/have_debug.inc
--source include/have_debug_sync.inc
--source include/have_binlog_format_row.inc

RESET MASTER;

CREATE TABLE t1 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Innodb;

# Test that
# 1. XA PREPARE is binlogged before the XA has been prepared in Engine
# 2. While XA PREPARE already binlogged in an old binlog file which has been rotated,
#    Binlog checkpoint is not generated for the latest log until
#    XA PREPARE returns, e.g OK to the client.


# con1 will hang before doing commit checkpoint, blocking RESET MASTER.
connect(con1,localhost,root,,);
SET DEBUG_SYNC= "at_unlog_xa_prepare SIGNAL con1_ready WAIT_FOR con1_go";
XA START '1';
INSERT INTO t1 SET a=1;
XA END '1';
--send XA PREPARE '1';


connection default;
SET DEBUG_SYNC= "now WAIT_FOR con1_ready";
FLUSH LOGS;
FLUSH LOGS;
FLUSH LOGS;

--source include/show_binary_logs.inc
--let $binlog_file= master-bin.000004
--let $binlog_start= 4
--source include/show_binlog_events.inc

SET DEBUG_SYNC= "now SIGNAL con1_go";

connection con1;
reap;
--echo *** master-bin.000004 checkpoint must show up now ***
--source include/wait_for_binlog_checkpoint.inc

# Todo: think about the error code returned, move to an appropriate test, or remove
# connection default;
#--error 1399
# DROP TABLE t1;

connection con1;
XA ROLLBACK '1';
SET debug_sync = 'reset';

# Clean up.
connection default;

DROP TABLE t1;
SET debug_sync = 'reset';