summaryrefslogtreecommitdiffstats
path: root/storage/rocksdb/mysql-test/rocksdb_rpl/t/rpl_xa.inc
blob: 253d9f16316ce1d5a390281026ed624b59eb09eb (plain)
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
#
# This "body" file checks general properties of XA transaction replication
# as of MDEV-7974, including XA of mixed engine branches.
# Parameters:
# --let rpl_xa_check= SELECT ...
#
connection master;
create table ti (a int, b int) engine=innodb;
create table t1 (a int, b int) engine=rocksdb;
insert into ti values(0, 0);
insert into t1 values(0, 0);
xa start 't';
insert into ti values(1, 2);
insert into t1 values(1, 2);
xa end 't';
xa prepare 't';
xa commit 't';

sync_slave_with_master;
let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;

connection master;

xa start 't';
insert into ti values(3, 4);
insert into t1 values(3, 4);
xa end 't';
xa prepare 't';
xa rollback 't';

sync_slave_with_master;
let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;

connection master;
SET pseudo_slave_mode=1;
create table t2 (a int) engine=rocksdb;
xa start 't';
insert into ti values (5, 6);
insert into t1 values (5, 6);
xa end 't';
xa prepare 't';
xa start 's';
insert into ti values (7, 8);
insert into t2 values (0);
xa end 's';
xa prepare 's';
--source include/save_master_gtid.inc

connection slave;
source include/sync_with_master_gtid.inc;
if ($rpl_xa_check)
{
  --eval $rpl_xa_check
  if ($rpl_xa_verbose)
  {
    --eval SELECT $rpl_xa_check_lhs
    --eval SELECT $rpl_xa_check_rhs
  }
}
xa recover;

connection master;
xa commit 't';
xa commit 's';
SET pseudo_slave_mode=0;

# pure rocksdb xa
xa start 'r';
insert into t1 values(7, 8);
xa end 'r';
xa prepare 'r';
xa commit 'r';


sync_slave_with_master;
let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
let $diff_tables= master:t2, slave:t2;
source include/diff_tables.inc;

connection master;
drop table ti, t1, t2;