Commit 2fe4761b authored by jan's avatar jan

Make innodb test case faster. Group all consistent read test cases to

a one test case and wait their lock timeout after all have been send
to the server.
parent f3bd718c
--binlog_cache_size=32768 --innodb_lock_wait_timeout=5 --loose_innodb_lock_wait_timeout=5
--binlog_cache_size=32768 --innodb_lock_wait_timeout=1 --loose_innodb_lock_wait_timeout=1
......@@ -3259,65 +3259,43 @@ update t1 set b = 5 where b = 1;
set autocommit = 0;
select * from t1 where a = 2 and b = 2 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t1 where b = 1 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
commit;
commit;
drop table t1;
create table t1(a int not null, b int, primary key(a)) engine=innodb;
insert into t1 values (1,2),(5,3),(4,2);
create table t2(a int not null, b int, primary key(a)) engine=innodb;
create table t2(d int not null, e int, primary key(d)) engine=innodb;
insert into t2 values (8,6),(12,1),(3,1);
commit;
set autocommit = 0;
select * from t2 for update;
a b
d e
3 1
8 6
12 1
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
insert into t1 select * from t2;
commit;
commit;
drop table t1, t2;
create table t1(a int not null, b int, primary key(a)) engine=innodb;
insert into t1 values (1,2),(5,3),(4,2);
create table t2(d int not null, e int, primary key(d)) engine=innodb;
insert into t2 values (1,6),(5,1),(4,1);
commit;
set autocommit = 0;
select * from t2 for update;
d e
1 6
4 1
5 1
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
update t1 set b = (select e from t2 where a = d);
commit;
commit;
drop table t1, t2;
create table t2(a int not null, b int, primary key(a)) engine=innodb;
insert into t2 values (1,6),(5,1),(4,1);
commit;
set autocommit = 0;
select * from t2 for update;
a b
1 6
4 1
5 1
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
create table t1(a int not null, b int, primary key(a)) engine=innodb
create table t3(d int not null, e int, primary key(d)) engine=innodb
select * from t2;
commit;
commit;
drop table t1, t2;
drop table t1, t2, t3;
create table t1(a int not null, b int, primary key(a)) engine=innodb;
insert into t1 values (1,2),(5,3),(4,2);
create table t2(a int not null, b int, primary key(a)) engine=innodb;
insert into t2 values (8,6),(12,1),(3,1);
create table t3(d int not null, b int, primary key(d)) engine=innodb;
insert into t3 values (8,6),(12,1),(3,1);
create table t5(a int not null, b int, primary key(a)) engine=innodb;
insert into t5 values (1,2),(5,3),(4,2);
create table t6(d int not null, e int, primary key(d)) engine=innodb;
insert into t6 values (8,6),(12,1),(3,1);
create table t8(a int not null, b int, primary key(a)) engine=innodb;
insert into t8 values (1,2),(5,3),(4,2);
create table t9(d int not null, e int, primary key(d)) engine=innodb;
insert into t9 values (8,6),(12,1),(3,1);
commit;
set autocommit = 0;
select * from t2 for update;
......@@ -3328,146 +3306,38 @@ a b
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
insert into t1 select * from t2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
commit;
commit;
drop table t1, t2;
create table t1(a int not null, b int, primary key(a)) engine=innodb;
insert into t1 values (1,2),(5,3),(4,2);
create table t2(d int not null, e int, primary key(d)) engine=innodb;
insert into t2 values (1,6),(5,1),(4,1);
commit;
set autocommit = 0;
select * from t2 for update;
d e
1 6
4 1
5 1
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
update t1 set b = (select e from t2 where a = d);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
commit;
commit;
drop table t1, t2;
create table t2(a int not null, b int, primary key(a)) engine=innodb;
insert into t2 values (1,6),(5,1),(4,1);
commit;
set autocommit = 0;
select * from t2 for update;
a b
1 6
4 1
5 1
update t3 set b = (select b from t2 where a = d);
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
create table t1(a int not null, b int, primary key(a)) engine=innodb
select * from t2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
commit;
commit;
drop table t2;
create table t1(a int not null, b int, primary key(a)) engine=innodb;
insert into t1 values (1,2),(5,3),(4,2);
create table t2(a int not null, b int, primary key(a)) engine=innodb;
insert into t2 values (8,6),(12,1),(3,1);
commit;
set autocommit = 0;
select * from t2 for update;
a b
3 1
8 6
12 1
create table t4(a int not null, b int, primary key(a)) engine=innodb select * from t2;
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
insert into t1 select * from t2 lock in share mode;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
commit;
commit;
drop table t1, t2;
create table t1(a int not null, b int, primary key(a)) engine=innodb;
insert into t1 values (1,2),(5,3),(4,2);
create table t2(d int not null, e int, primary key(d)) engine=innodb;
insert into t2 values (1,6),(5,1),(4,1);
commit;
set autocommit = 0;
select * from t2 for update;
d e
1 6
4 1
5 1
insert into t5 (select * from t2 lock in share mode);
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
update t1 set b = (select e from t2 where a = d lock in share mode);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
commit;
commit;
drop table t1, t2;
create table t2(a int not null, b int, primary key(a)) engine=innodb;
insert into t2 values (1,6),(5,1),(4,1);
commit;
set autocommit = 0;
select * from t2 for update;
a b
1 6
4 1
5 1
update t6 set e = (select b from t2 where a = d lock in share mode);
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
create table t1(a int not null, b int, primary key(a)) engine=innodb select * from t2 lock in share mode;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
commit;
commit;
drop table t2;
create table t1(a int not null, b int, primary key(a)) engine=innodb;
insert into t1 values (1,2),(5,3),(4,2);
create table t2(a int not null, b int, primary key(a)) engine=innodb;
insert into t2 values (8,6),(12,1),(3,1);
commit;
set autocommit = 0;
select * from t2 for update;
a b
3 1
8 6
12 1
create table t7(a int not null, b int, primary key(a)) engine=innodb select * from t2 lock in share mode;
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
insert into t1 select * from t2 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
commit;
commit;
drop table t1, t2;
create table t1(a int not null, b int, primary key(a)) engine=innodb;
insert into t1 values (1,2),(5,3),(4,2);
create table t2(d int not null, e int, primary key(d)) engine=innodb;
insert into t2 values (1,6),(5,1),(4,1);
commit;
set autocommit = 0;
select * from t2 for update;
d e
1 6
4 1
5 1
insert into t8 (select * from t2 for update);
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
update t1 set b = (select e from t2 where a = d for update);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
commit;
commit;
drop table t1, t2;
create table t2(a int not null, b int, primary key(a)) engine=innodb;
insert into t2 values (1,6),(5,1),(4,1);
commit;
set autocommit = 0;
select * from t2 for update;
a b
1 6
4 1
5 1
update t9 set e = (select b from t2 where a = d for update);
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
create table t1(a int not null, b int, primary key(a)) engine=innodb select * from t2 for update;
create table t10(a int not null, b int, primary key(a)) engine=innodb select * from t2 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
commit;
commit;
drop table t2;
drop table t1, t2, t3, t5, t6, t8, t9;
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment