1--source include/have_tokudb.inc
2--source include/have_binlog_format_mixed_or_row.inc
3--source include/master-slave.inc
4
5CREATE TABLE t1(`a` INT) ENGINE=TokuDB;
6
7## XA interleave commit
8--connection master
9XA START 'x1';
10INSERT INTO t1 VALUES (1);
11XA END 'x1';
12XA PREPARE 'x1';
13
14--connection master1
15BEGIN;
16INSERT INTO t1 VALUES (10);
17COMMIT;
18XA START 'y1';
19INSERT INTO t1 VALUES (2);
20XA END 'y1';
21XA PREPARE 'y1';
22
23--connection master
24XA COMMIT 'x1';
25
26--connection master1
27XA COMMIT 'y1';
28
29--connection master
30BEGIN;
31INSERT INTO t1 VALUES (11);
32COMMIT;
33XA START 'x2';
34INSERT INTO t1 VALUES (3);
35XA END 'x2';
36XA PREPARE 'x2';
37
38--connection master1
39XA START 'y2';
40INSERT INTO t1 VALUES (4);
41XA END 'y2';
42XA PREPARE 'y2';
43
44--connection master
45XA COMMIT 'x2';
46
47--connection master1
48XA COMMIT 'y2';
49
50## XA interleave rollback
51--connection master
52XA START 'x1';
53INSERT INTO t1 VALUES (1);
54XA END 'x1';
55XA PREPARE 'x1';
56
57--connection master1
58BEGIN;
59INSERT INTO t1 VALUES (10);
60COMMIT;
61XA START 'y1';
62INSERT INTO t1 VALUES (2);
63XA END 'y1';
64XA PREPARE 'y1';
65
66--connection master
67XA ROLLBACK 'x1';
68
69--connection master1
70XA ROLLBACK 'y1';
71
72--connection master
73BEGIN;
74INSERT INTO t1 VALUES (11);
75COMMIT;
76XA START 'x2';
77INSERT INTO t1 VALUES (3);
78XA END 'x2';
79XA PREPARE 'x2';
80
81--connection master1
82XA START 'y2';
83INSERT INTO t1 VALUES (4);
84XA END 'y2';
85XA PREPARE 'y2';
86
87--connection master
88XA ROLLBACK 'x2';
89
90--connection master1
91XA ROLLBACK 'y2';
92
93--connection master
94
95--sync_slave_with_master
96
97--echo TABLES t1 and t2 must be equal otherwise an error will be thrown.
98--let $diff_tables= master:test.t1, slave:test.t1
99--source include/diff_tables.inc
100
101--connection master
102DROP TABLE t1;
103--source include/rpl_end.inc
104