| 1 |
drop table if exists t1; |
| 2 |
connect a,localhost,root,,; |
| 3 |
connect b,localhost,root,,; |
| 4 |
connection a; |
| 5 |
set session transaction isolation level read committed; |
| 6 |
create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1; |
| 7 |
create table t2 like t1; |
| 8 |
insert into t2 values (1),(2),(3),(4),(5),(6),(7); |
| 9 |
set autocommit=0; |
| 10 |
begin; |
| 11 |
replace into t1 select * from t2; |
| 12 |
connection b; |
| 13 |
set session transaction isolation level read committed; |
| 14 |
set autocommit=0; |
| 15 |
delete from t2 where a=5; |
| 16 |
commit; |
| 17 |
delete from t2; |
| 18 |
commit; |
| 19 |
connection a; |
| 20 |
commit; |
| 21 |
begin; |
| 22 |
insert into t1 select * from t2; |
| 23 |
connection b; |
| 24 |
set session transaction isolation level read committed; |
| 25 |
set autocommit=0; |
| 26 |
delete from t2 where a=5; |
| 27 |
commit; |
| 28 |
delete from t2; |
| 29 |
commit; |
| 30 |
connection a; |
| 31 |
commit; |
| 32 |
select * from t1; |
| 33 |
a |
| 34 |
1 |
| 35 |
2 |
| 36 |
3 |
| 37 |
4 |
| 38 |
5 |
| 39 |
6 |
| 40 |
7 |
| 41 |
drop table t1; |
| 42 |
drop table t2; |
| 43 |
connection default; |
| 44 |
disconnect a; |
| 45 |
disconnect b; |