Debian Codegraph @

mysql-test/suite/ndb_binlog/t/ndb_binlog_log_transaction_id.test

raw
1 --source include/have_ndb.inc
2 --source include/have_log_bin.inc
3 --source include/have_debug.inc
4
5 use test;
6
7 create table t1 (a int primary key, b int) engine=ndb;
8 create table t2 (a int primary key, b int) engine=ndb;
9
10 --echo Single row autocommit transactions
11 --echo Should have 1 transaction id
12 insert into t1 values (1,1);
13
14 let $wait_binlog_event= COMMIT;
15 --source include/wait_for_binlog_event.inc
16 --source suite/ndb_binlog/t/ndb_binlog_get_row_extra_data.inc
17 reset master;
18
19 --echo Should have 1 transaction id
20 insert into t1 values (2,2);
21
22 let $wait_binlog_event= COMMIT;
23 --source include/wait_for_binlog_event.inc
24 --source suite/ndb_binlog/t/ndb_binlog_get_row_extra_data.inc
25 reset master;
26
27 --echo Should have 1 transaction id
28 update t1 set b=20 where a=2;
29
30 let $wait_binlog_event= COMMIT;
31 --source include/wait_for_binlog_event.inc
32 --source suite/ndb_binlog/t/ndb_binlog_get_row_extra_data.inc
33 reset master;
34
35 --echo Multi row autocommit transaction
36 --echo Should have 1 transaction id
37 delete from t1;
38
39 let $wait_binlog_event= COMMIT;
40 --source include/wait_for_binlog_event.inc
41 --source suite/ndb_binlog/t/ndb_binlog_get_row_extra_data.inc
42 reset master;
43
44 --echo Multi row explicit transaction
45 --echo Should have 1 transaction id
46 begin;
47 insert into t1 values (3,3);
48 insert into t1 values (4,4);
49 insert into t1 values (5,5);
50 commit;
51
52 let $wait_binlog_event= COMMIT;
53 --source include/wait_for_binlog_event.inc
54 --source suite/ndb_binlog/t/ndb_binlog_get_row_extra_data.inc
55 reset master;
56
57 --echo Should have 1 transaction id
58 begin;
59 insert into t1 values (6,6);
60 update t1 set b=40 where a=4;
61 delete from t1 where a=5;
62 commit;
63
64 let $wait_binlog_event= COMMIT;
65 --source include/wait_for_binlog_event.inc
66 --source suite/ndb_binlog/t/ndb_binlog_get_row_extra_data.inc
67 reset master;
68
69 --echo Multi table explicit transaction
70 --echo Should have 1 transaction id
71 begin;
72 insert into t1 values (7,7);
73 insert into t2 values (7,7);
74 insert into t2 values (8,8);
75 commit;
76
77 let $wait_binlog_event= COMMIT;
78 --source include/wait_for_binlog_event.inc
79 --source suite/ndb_binlog/t/ndb_binlog_get_row_extra_data.inc
80 reset master;
81
82 --echo Multiple autocommit transactions
83 --echo Should have 2 transaction ids
84 insert into t1 values (8,8);
85 insert into t1 values (9,9);
86
87 let $wait_binlog_event= COMMIT;
88 --source include/wait_for_binlog_event.inc
89 --source suite/ndb_binlog/t/ndb_binlog_get_row_extra_data.inc
90 reset master;
91
92 --echo Multiple autocommit transactions on single row
93 --echo Should have 3 transaction ids
94 insert into t1 values (10,10);
95 update t1 set b=100 where a=10;
96 delete from t1 where a=10;
97
98 let $wait_binlog_event= COMMIT;
99 --source include/wait_for_binlog_event.inc
100 --source suite/ndb_binlog/t/ndb_binlog_get_row_extra_data.inc
101 reset master;
102
103 --echo Multiple explicit transactions
104 --echo Should have 2 transaction ids
105 begin;
106 insert into t1 values (11,11);
107 delete from t1;
108 commit;
109
110 begin;
111 insert into t2 values (11,11);
112 delete from t2;
113 commit;
114
115 let $wait_binlog_event= COMMIT;
116 --source include/wait_for_binlog_event.inc
117 --source suite/ndb_binlog/t/ndb_binlog_get_row_extra_data.inc
118 reset master;
119
120
121 drop table t1;
122 drop table t2;