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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
SET binlog_format= mixed;
RESET MASTER;
XA START 'xatest';
INSERT INTO t1 VALUES (1);
XA END 'xatest';
XA PREPARE 'xatest';
XA COMMIT 'xatest';
XA START 'xatest';
INSERT INTO t1 VALUES (2);
XA END 'xatest';
XA COMMIT 'xatest' ONE PHASE;
BEGIN;
INSERT INTO t1 VALUES (3);
COMMIT;
SELECT * FROM t1 ORDER BY a;
a
1
2
3
DROP TABLE t1;
CREATE TABLE t1 (a INT) ENGINE=Aria;
INSERT INTO t1 VALUES (1),(2);
XA BEGIN 'x';
DELETE FROM t1;
XA END 'x';
XA PREPARE 'x';
Warnings:
Warning 1030 Got error 131 "Command not supported by the engine" from storage engine Aria
XA COMMIT 'x';
SELECT * from t1;
a
XA BEGIN 'x';
INSERT INTO t1 VALUES (3),(4);
XA END 'x';
XA PREPARE 'x';
Warnings:
Warning 1030 Got error 131 "Command not supported by the engine" from storage engine Aria
XA ROLLBACK 'x';
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
SELECT * from t1;
a
3
4
DROP TABLE t1;
SHOW BINLOG EVENTS LIMIT 3,100;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid 1 # XA START X'786174657374',X'',1 GTID #-#-#
master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES (1)
master-bin.000001 # Query 1 # XA END X'786174657374',X'',1
master-bin.000001 # XA_prepare 1 # XA PREPARE X'786174657374',X'',1
master-bin.000001 # Gtid 1 # GTID #-#-#
master-bin.000001 # Query 1 # XA COMMIT X'786174657374',X'',1
master-bin.000001 # Gtid 1 # BEGIN GTID #-#-#
master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES (2)
master-bin.000001 # Xid 1 # COMMIT /* xid=XX */
master-bin.000001 # Gtid 1 # BEGIN GTID #-#-#
master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES (3)
master-bin.000001 # Xid 1 # COMMIT /* xid=XX */
master-bin.000001 # Gtid 1 # GTID #-#-#
master-bin.000001 # Query 1 # use `test`; DROP TABLE `t1` /* generated by server */
master-bin.000001 # Gtid 1 # GTID #-#-#
master-bin.000001 # Query 1 # use `test`; CREATE TABLE t1 (a INT) ENGINE=Aria
master-bin.000001 # Gtid 1 # BEGIN GTID #-#-#
master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES (1),(2)
master-bin.000001 # Query 1 # COMMIT
master-bin.000001 # Gtid 1 # BEGIN GTID #-#-#
master-bin.000001 # Query 1 # use `test`; DELETE FROM t1
master-bin.000001 # Query 1 # COMMIT
master-bin.000001 # Gtid 1 # XA START X'78',X'',1 GTID #-#-#
master-bin.000001 # Query 1 # XA END X'78',X'',1
master-bin.000001 # XA_prepare 1 # XA PREPARE X'78',X'',1
master-bin.000001 # Gtid 1 # GTID #-#-#
master-bin.000001 # Query 1 # XA COMMIT X'78',X'',1
master-bin.000001 # Gtid 1 # BEGIN GTID #-#-#
master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES (3),(4)
master-bin.000001 # Query 1 # COMMIT
master-bin.000001 # Gtid 1 # XA START X'78',X'',1 GTID #-#-#
master-bin.000001 # Query 1 # XA END X'78',X'',1
master-bin.000001 # XA_prepare 1 # XA PREPARE X'78',X'',1
master-bin.000001 # Gtid 1 # GTID #-#-#
master-bin.000001 # Query 1 # XA ROLLBACK X'78',X'',1
master-bin.000001 # Gtid 1 # GTID #-#-#
master-bin.000001 # Query 1 # use `test`; DROP TABLE `t1` /* generated by server */
|