| 1 |
show variables like '%binlog_format%'; |
| 2 |
Variable_name Value |
| 3 |
binlog_format ROW |
| 4 |
use test; |
| 5 |
create table test.t1 (a int primary key, b int) engine=myisam; |
| 6 |
create table test.notes (a varchar(1000)) engine=myisam; |
| 7 |
reset master; |
| 8 |
insert into test.notes values ("Scattered single statement transactions"); |
| 9 |
insert into test.t1 values (1,1); |
| 10 |
insert into test.t1 values (2,2); |
| 11 |
update test.t1 set b=20 where a=2; |
| 12 |
delete from test.t1 where a=1; |
| 13 |
insert into test.notes values ("Some composite transactions, starting with diff ops"); |
| 14 |
begin; |
| 15 |
insert into t1 values (10,10); |
| 16 |
update t1 set b=11 where a=10; |
| 17 |
commit; |
| 18 |
begin; |
| 19 |
update t1 set b=20 where a=10; |
| 20 |
insert into t1 values (21,21); |
| 21 |
commit; |
| 22 |
begin; |
| 23 |
delete from t1 where a=10; |
| 24 |
update t1 set b=22 where a=21; |
| 25 |
commit; |
| 26 |
insert into test.notes values ("Some composite transactions with multiple ops"); |
| 27 |
begin; |
| 28 |
insert into t1 values (30,30); |
| 29 |
insert into t1 values (31,31); |
| 30 |
insert into t1 values (32,32); |
| 31 |
insert into t1 values (33,33); |
| 32 |
insert into t1 values (34,34); |
| 33 |
insert into t1 values (35,35); |
| 34 |
insert into t1 values (36,36); |
| 35 |
insert into t1 values (37,37); |
| 36 |
insert into t1 values (38,38); |
| 37 |
insert into t1 values (39,39); |
| 38 |
commit; |
| 39 |
begin; |
| 40 |
update t1 set b=b+10 where a >= 30; |
| 41 |
commit; |
| 42 |
begin; |
| 43 |
delete from t1 where a >= 30; |
| 44 |
commit; |
| 45 |
flush logs; |
| 46 |
drop table test.t1; |
| 47 |
drop table test.notes; |
| 48 |
create table test.t1 (a int primary key, b int) engine=ndb; |
| 49 |
create table test.notes (a varchar(1000)) engine=ndb; |
| 50 |
select * from test.t1; |
| 51 |
a b |
| 52 |
2 20 |
| 53 |
21 22 |
| 54 |
drop table test.t1; |
| 55 |
drop table test.notes; |