| 1 |
use test; |
| 2 |
create table t1 (a int primary key, b int) engine=ndb; |
| 3 |
create table t2 (a int primary key, b int) engine=ndb; |
| 4 |
Single row autocommit transactions |
| 5 |
Should have 1 transaction id |
| 6 |
insert into t1 values (1,1); |
| 7 |
Number of different transaction ids in Binlog |
| 8 |
select count(1) as number_of_transactions from diff_extra_data; |
| 9 |
number_of_transactions |
| 10 |
1 |
| 11 |
reset master; |
| 12 |
Should have 1 transaction id |
| 13 |
insert into t1 values (2,2); |
| 14 |
Number of different transaction ids in Binlog |
| 15 |
select count(1) as number_of_transactions from diff_extra_data; |
| 16 |
number_of_transactions |
| 17 |
1 |
| 18 |
reset master; |
| 19 |
Should have 1 transaction id |
| 20 |
update t1 set b=20 where a=2; |
| 21 |
Number of different transaction ids in Binlog |
| 22 |
select count(1) as number_of_transactions from diff_extra_data; |
| 23 |
number_of_transactions |
| 24 |
1 |
| 25 |
reset master; |
| 26 |
Multi row autocommit transaction |
| 27 |
Should have 1 transaction id |
| 28 |
delete from t1; |
| 29 |
Number of different transaction ids in Binlog |
| 30 |
select count(1) as number_of_transactions from diff_extra_data; |
| 31 |
number_of_transactions |
| 32 |
1 |
| 33 |
reset master; |
| 34 |
Multi row explicit transaction |
| 35 |
Should have 1 transaction id |
| 36 |
begin; |
| 37 |
insert into t1 values (3,3); |
| 38 |
insert into t1 values (4,4); |
| 39 |
insert into t1 values (5,5); |
| 40 |
commit; |
| 41 |
Number of different transaction ids in Binlog |
| 42 |
select count(1) as number_of_transactions from diff_extra_data; |
| 43 |
number_of_transactions |
| 44 |
1 |
| 45 |
reset master; |
| 46 |
Should have 1 transaction id |
| 47 |
begin; |
| 48 |
insert into t1 values (6,6); |
| 49 |
update t1 set b=40 where a=4; |
| 50 |
delete from t1 where a=5; |
| 51 |
commit; |
| 52 |
Number of different transaction ids in Binlog |
| 53 |
select count(1) as number_of_transactions from diff_extra_data; |
| 54 |
number_of_transactions |
| 55 |
1 |
| 56 |
reset master; |
| 57 |
Multi table explicit transaction |
| 58 |
Should have 1 transaction id |
| 59 |
begin; |
| 60 |
insert into t1 values (7,7); |
| 61 |
insert into t2 values (7,7); |
| 62 |
insert into t2 values (8,8); |
| 63 |
commit; |
| 64 |
Number of different transaction ids in Binlog |
| 65 |
select count(1) as number_of_transactions from diff_extra_data; |
| 66 |
number_of_transactions |
| 67 |
1 |
| 68 |
reset master; |
| 69 |
Multiple autocommit transactions |
| 70 |
Should have 2 transaction ids |
| 71 |
insert into t1 values (8,8); |
| 72 |
insert into t1 values (9,9); |
| 73 |
Number of different transaction ids in Binlog |
| 74 |
select count(1) as number_of_transactions from diff_extra_data; |
| 75 |
number_of_transactions |
| 76 |
2 |
| 77 |
reset master; |
| 78 |
Multiple autocommit transactions on single row |
| 79 |
Should have 3 transaction ids |
| 80 |
insert into t1 values (10,10); |
| 81 |
update t1 set b=100 where a=10; |
| 82 |
delete from t1 where a=10; |
| 83 |
Number of different transaction ids in Binlog |
| 84 |
select count(1) as number_of_transactions from diff_extra_data; |
| 85 |
number_of_transactions |
| 86 |
3 |
| 87 |
reset master; |
| 88 |
Multiple explicit transactions |
| 89 |
Should have 2 transaction ids |
| 90 |
begin; |
| 91 |
insert into t1 values (11,11); |
| 92 |
delete from t1; |
| 93 |
commit; |
| 94 |
begin; |
| 95 |
insert into t2 values (11,11); |
| 96 |
delete from t2; |
| 97 |
commit; |
| 98 |
Number of different transaction ids in Binlog |
| 99 |
select count(1) as number_of_transactions from diff_extra_data; |
| 100 |
number_of_transactions |
| 101 |
2 |
| 102 |
reset master; |
| 103 |
drop table t1; |
| 104 |
drop table t2; |