| 1 |
drop table if exists t1; |
| 2 |
show variables like 'innodb_rollback_on_timeout'; |
| 3 |
Variable_name Value |
| 4 |
innodb_rollback_on_timeout ON |
| 5 |
create table t1 (a int unsigned not null primary key) engine = innodb; |
| 6 |
insert into t1 values (1); |
| 7 |
commit; |
| 8 |
connect con1,localhost,root,,; |
| 9 |
connect con2,localhost,root,,; |
| 10 |
connection con2; |
| 11 |
begin work; |
| 12 |
insert into t1 values (2); |
| 13 |
select * from t1; |
| 14 |
a |
| 15 |
1 |
| 16 |
2 |
| 17 |
connection con1; |
| 18 |
begin work; |
| 19 |
insert into t1 values (5); |
| 20 |
insert into t1 values (2); |
| 21 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 22 |
select * from t1; |
| 23 |
a |
| 24 |
1 |
| 25 |
commit; |
| 26 |
connection con2; |
| 27 |
select * from t1; |
| 28 |
a |
| 29 |
1 |
| 30 |
2 |
| 31 |
commit; |
| 32 |
connection default; |
| 33 |
select * from t1; |
| 34 |
a |
| 35 |
1 |
| 36 |
2 |
| 37 |
drop table t1; |
| 38 |
disconnect con1; |
| 39 |
disconnect con2; |
| 40 |
# End of 5.0 tests |