Commit bfc113c9 authored by John Esmet's avatar John Esmet

[t:3453] getting rid of old test results, adding new ones


git-svn-id: file:///svn/mysql/tests/mysql-test@35021 c7de825b-a66e-492c-adef-691d508d4ae1
parent 6a148af4
set storage_engine='tokudb';
set global tokudb_lock_timeout=1000000;
drop table if exists t;
create table t (a int primary key, b int);
insert into t values (1, 1);
insert into t values (2, 4);
insert into t values (3, 9);
insert into t values (4, 16);
set autocommit=off;
set session transaction isolation level serializable;
begin;
select * from t where a=1 for update;
a b
1 1
set session transaction isolation level serializable;
select * from t where a=1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a=2;
a b
2 4
select * from t where a=3;
a b
3 9
select * from t where a=4;
a b
4 16
commit;
select * from t;
a b
1 1
2 4
3 9
4 16
begin;
select * from t where a<=2 for update;
a b
1 1
2 4
select * from t where a=1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a=4;
a b
4 16
commit;
select * from t;
a b
1 1
2 4
3 9
4 16
begin;
replace into t values(1, 10),(3,30);
select * from t where a=1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a=3;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a=2;
a b
2 4
select * from t where a=4;
a b
4 16
commit;
select * from t;
a b
1 10
2 4
3 30
4 16
drop table t;
set global tokudb_lock_timeout=30000000;
select @@tokudb_lock_timeout;
@@tokudb_lock_timeout
30000000
set storage_engine='tokudb';
set global tokudb_lock_timeout=0;
select @@tokudb_lock_timeout;
@@tokudb_lock_timeout
0
drop table if exists t;
create table t (a int primary key, b int);
insert into t values (1,0),(2,0),(3,0),(4,0);
commit;
select @@autocommit;
@@autocommit
1
set autocommit=off;
select @@autocommit;
@@autocommit
1
set autocommit=off;
select * from t where a=1 for update;
a b
1 0
select * from t where a=1 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
commit;
commit;
set global tokudb_lock_timeout=30000000;
drop table t;
set storage_engine=tokudb;
drop table if exists t;
create table t (a int primary key, b int);
insert ignore t values(1, 1);
insert ignore t values(2, 4);
insert ignore t values(3, 9);
insert ignore t values(4, 16);
insert ignore t values(5, 25);
insert ignore t values(6, 36);
set global tokudb_lock_timeout=0;
begin;
select * from t where a=1 for update;
a b
1 1
select * from t where a=1 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a=2 for update;
a b
2 4
select * from t where a=3 for update;
a b
3 9
select * from t where a=4 for update;
a b
4 16
commit;
select * from t where a=1 for update;
a b
1 1
select * from t;
a b
1 1
2 4
3 9
4 16
5 25
6 36
begin;
select * from t where a=1 for update;
a b
1 1
update t set b=b where a=1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a=2;
update t set b=b where a=3;
update t set b=b where a=4;
commit;
update t set b=b where a=1;
select * from t;
a b
1 1
2 4
3 9
4 16
5 25
6 36
begin;
select * from t where a=1 for update;
a b
1 1
insert ignore t values(1, 100);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert ignore t values(2, 100);
insert ignore t values(3, 100);
insert ignore t values(4, 100);
commit;
insert ignore t values(1, 100);
select * from t;
a b
1 1
2 4
3 9
4 16
5 25
6 36
begin;
select * from t where a=1 for update;
a b
1 1
replace t values(1, 100);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
replace t values(2, 100);
replace t values(3, 100);
replace t values(4, 100);
commit;
replace t values(1, 100);
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
select * from t where a=1 for update;
a b
1 100
select * from t where a<=2 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=0 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>2 for update;
a b
3 100
4 100
5 25
6 36
commit;
select * from t where a<=2 for update;
a b
1 100
2 100
select * from t where a>=0 for update;
a b
1 100
2 100
3 100
4 100
5 25
6 36
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
select * from t where a=1 for update;
a b
1 100
update t set b=b where a<=2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a>=0;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a>2;
commit;
update t set b=b where a<=2;
update t set b=b where a>=0;
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
update t set b=b where a=1;
select * from t where a=1 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a=2 for update;
a b
2 100
select * from t where a=3 for update;
a b
3 100
select * from t where a=4 for update;
a b
4 100
commit;
select * from t where a=1 for update;
a b
1 100
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
update t set b=b where a=1;
update t set b=b where a=1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a=2;
update t set b=b where a=3;
update t set b=b where a=4;
commit;
update t set b=b where a=1;
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
update t set b=b where a=1;
insert ignore t values(1, 100);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert ignore t values(2, 100);
insert ignore t values(3, 100);
insert ignore t values(4, 100);
commit;
insert ignore t values(1, 100);
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
update t set b=b where a=1;
replace t values(1, 100);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
replace t values(2, 100);
replace t values(3, 100);
replace t values(4, 100);
commit;
replace t values(1, 100);
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
update t set b=b where a=1;
select * from t where a<=2 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=0 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>2 for update;
a b
3 100
4 100
5 25
6 36
commit;
select * from t where a<=2 for update;
a b
1 100
2 100
select * from t where a>=0 for update;
a b
1 100
2 100
3 100
4 100
5 25
6 36
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
update t set b=b where a=1;
update t set b=b where a<=2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a>=0;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a>2;
commit;
update t set b=b where a<=2;
update t set b=b where a>=0;
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
insert ignore t values(1, 100);
select * from t where a=1 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a=2 for update;
a b
2 100
select * from t where a=3 for update;
a b
3 100
select * from t where a=4 for update;
a b
4 100
commit;
select * from t where a=1 for update;
a b
1 100
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
insert ignore t values(1, 100);
update t set b=b where a=1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a=2;
update t set b=b where a=3;
update t set b=b where a=4;
commit;
update t set b=b where a=1;
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
insert ignore t values(1, 100);
insert ignore t values(1, 100);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert ignore t values(2, 100);
insert ignore t values(3, 100);
insert ignore t values(4, 100);
commit;
insert ignore t values(1, 100);
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
insert ignore t values(1, 100);
replace t values(1, 100);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
replace t values(2, 100);
replace t values(3, 100);
replace t values(4, 100);
commit;
replace t values(1, 100);
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
insert ignore t values(1, 100);
select * from t where a<=2 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=0 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>2 for update;
a b
3 100
4 100
5 25
6 36
commit;
select * from t where a<=2 for update;
a b
1 100
2 100
select * from t where a>=0 for update;
a b
1 100
2 100
3 100
4 100
5 25
6 36
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
insert ignore t values(1, 100);
update t set b=b where a<=2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a>=0;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a>2;
commit;
update t set b=b where a<=2;
update t set b=b where a>=0;
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
replace t values(1, 100);
select * from t where a=1 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a=2 for update;
a b
2 100
select * from t where a=3 for update;
a b
3 100
select * from t where a=4 for update;
a b
4 100
commit;
select * from t where a=1 for update;
a b
1 100
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
replace t values(1, 100);
update t set b=b where a=1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a=2;
update t set b=b where a=3;
update t set b=b where a=4;
commit;
update t set b=b where a=1;
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
replace t values(1, 100);
insert ignore t values(1, 100);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert ignore t values(2, 100);
insert ignore t values(3, 100);
insert ignore t values(4, 100);
commit;
insert ignore t values(1, 100);
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
replace t values(1, 100);
replace t values(1, 100);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
replace t values(2, 100);
replace t values(3, 100);
replace t values(4, 100);
commit;
replace t values(1, 100);
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
replace t values(1, 100);
select * from t where a<=2 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=0 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>2 for update;
a b
3 100
4 100
5 25
6 36
commit;
select * from t where a<=2 for update;
a b
1 100
2 100
select * from t where a>=0 for update;
a b
1 100
2 100
3 100
4 100
5 25
6 36
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
replace t values(1, 100);
update t set b=b where a<=2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a>=0;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a>2;
commit;
update t set b=b where a<=2;
update t set b=b where a>=0;
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
select * from t where a>=2 and a<=4 for update;
a b
2 100
3 100
4 100
select * from t where a>=0 and a<=3 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=3 and a<=6 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a<=2 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=5 for update;
a b
5 25
6 36
commit;
select * from t where a>=0 and a<=3 for update;
a b
1 100
2 100
3 100
select * from t where a>=3 and a<=6 for update;
a b
3 100
4 100
5 25
6 36
select * from t where a<=2 for update;
a b
1 100
2 100
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
select * from t where a>=2 and a<=4 for update;
a b
2 100
3 100
4 100
update t set b=b where a>=0 and a<=3;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a>=3 and a<=6;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a<=2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a>=5;
commit;
update t set b=b where a>=0 and a<=3;
update t set b=b where a>=3 and a<=6;
update t set b=b where a<=2;
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
update t set b=b where a>=2 and a<=4;
select * from t where a>=0 and a<=3 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=3 and a<=6 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a<=2 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=5 for update;
a b
5 25
6 36
commit;
select * from t where a>=0 and a<=3 for update;
a b
1 100
2 100
3 100
select * from t where a>=3 and a<=6 for update;
a b
3 100
4 100
5 25
6 36
select * from t where a<=2 for update;
a b
1 100
2 100
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
update t set b=b where a>=2 and a<=4;
update t set b=b where a>=0 and a<=3;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a>=3 and a<=6;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a<=2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a>=5;
commit;
update t set b=b where a>=0 and a<=3;
update t set b=b where a>=3 and a<=6;
update t set b=b where a<=2;
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
set global tokudb_lock_timeout=1000000;
begin;
select * from t where a=1 for update;
a b
1 100
select * from t where a=1 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a=2 for update;
a b
2 100
select * from t where a=3 for update;
a b
3 100
select * from t where a=4 for update;
a b
4 100
commit;
select * from t where a=1 for update;
a b
1 100
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
select * from t where a=1 for update;
a b
1 100
update t set b=b where a=1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a=2;
update t set b=b where a=3;
update t set b=b where a=4;
commit;
update t set b=b where a=1;
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
select * from t where a=1 for update;
a b
1 100
insert ignore t values(1, 100);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert ignore t values(2, 100);
insert ignore t values(3, 100);
insert ignore t values(4, 100);
commit;
insert ignore t values(1, 100);
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
select * from t where a=1 for update;
a b
1 100
replace t values(1, 100);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
replace t values(2, 100);
replace t values(3, 100);
replace t values(4, 100);
commit;
replace t values(1, 100);
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
select * from t where a=1 for update;
a b
1 100
select * from t where a<=2 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=0 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>2 for update;
a b
3 100
4 100
5 25
6 36
commit;
select * from t where a<=2 for update;
a b
1 100
2 100
select * from t where a>=0 for update;
a b
1 100
2 100
3 100
4 100
5 25
6 36
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
select * from t where a=1 for update;
a b
1 100
update t set b=b where a<=2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a>=0;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a>2;
commit;
update t set b=b where a<=2;
update t set b=b where a>=0;
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
update t set b=b where a=1;
select * from t where a=1 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a=2 for update;
a b
2 100
select * from t where a=3 for update;
a b
3 100
select * from t where a=4 for update;
a b
4 100
commit;
select * from t where a=1 for update;
a b
1 100
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
update t set b=b where a=1;
update t set b=b where a=1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a=2;
update t set b=b where a=3;
update t set b=b where a=4;
commit;
update t set b=b where a=1;
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
update t set b=b where a=1;
insert ignore t values(1, 100);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert ignore t values(2, 100);
insert ignore t values(3, 100);
insert ignore t values(4, 100);
commit;
insert ignore t values(1, 100);
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
update t set b=b where a=1;
replace t values(1, 100);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
replace t values(2, 100);
replace t values(3, 100);
replace t values(4, 100);
commit;
replace t values(1, 100);
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
update t set b=b where a=1;
select * from t where a<=2 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=0 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>2 for update;
a b
3 100
4 100
5 25
6 36
commit;
select * from t where a<=2 for update;
a b
1 100
2 100
select * from t where a>=0 for update;
a b
1 100
2 100
3 100
4 100
5 25
6 36
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
update t set b=b where a=1;
update t set b=b where a<=2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a>=0;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a>2;
commit;
update t set b=b where a<=2;
update t set b=b where a>=0;
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
insert ignore t values(1, 100);
select * from t where a=1 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a=2 for update;
a b
2 100
select * from t where a=3 for update;
a b
3 100
select * from t where a=4 for update;
a b
4 100
commit;
select * from t where a=1 for update;
a b
1 100
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
insert ignore t values(1, 100);
update t set b=b where a=1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a=2;
update t set b=b where a=3;
update t set b=b where a=4;
commit;
update t set b=b where a=1;
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
insert ignore t values(1, 100);
insert ignore t values(1, 100);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert ignore t values(2, 100);
insert ignore t values(3, 100);
insert ignore t values(4, 100);
commit;
insert ignore t values(1, 100);
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
insert ignore t values(1, 100);
replace t values(1, 100);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
replace t values(2, 100);
replace t values(3, 100);
replace t values(4, 100);
commit;
replace t values(1, 100);
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
insert ignore t values(1, 100);
select * from t where a<=2 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=0 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>2 for update;
a b
3 100
4 100
5 25
6 36
commit;
select * from t where a<=2 for update;
a b
1 100
2 100
select * from t where a>=0 for update;
a b
1 100
2 100
3 100
4 100
5 25
6 36
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
insert ignore t values(1, 100);
update t set b=b where a<=2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a>=0;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a>2;
commit;
update t set b=b where a<=2;
update t set b=b where a>=0;
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
replace t values(1, 100);
select * from t where a=1 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a=2 for update;
a b
2 100
select * from t where a=3 for update;
a b
3 100
select * from t where a=4 for update;
a b
4 100
commit;
select * from t where a=1 for update;
a b
1 100
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
replace t values(1, 100);
update t set b=b where a=1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a=2;
update t set b=b where a=3;
update t set b=b where a=4;
commit;
update t set b=b where a=1;
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
replace t values(1, 100);
insert ignore t values(1, 100);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert ignore t values(2, 100);
insert ignore t values(3, 100);
insert ignore t values(4, 100);
commit;
insert ignore t values(1, 100);
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
replace t values(1, 100);
replace t values(1, 100);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
replace t values(2, 100);
replace t values(3, 100);
replace t values(4, 100);
commit;
replace t values(1, 100);
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
replace t values(1, 100);
select * from t where a<=2 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=0 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>2 for update;
a b
3 100
4 100
5 25
6 36
commit;
select * from t where a<=2 for update;
a b
1 100
2 100
select * from t where a>=0 for update;
a b
1 100
2 100
3 100
4 100
5 25
6 36
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
replace t values(1, 100);
update t set b=b where a<=2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a>=0;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a>2;
commit;
update t set b=b where a<=2;
update t set b=b where a>=0;
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
select * from t where a>=2 and a<=4 for update;
a b
2 100
3 100
4 100
select * from t where a>=0 and a<=3 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=3 and a<=6 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a<=2 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=5 for update;
a b
5 25
6 36
commit;
select * from t where a>=0 and a<=3 for update;
a b
1 100
2 100
3 100
select * from t where a>=3 and a<=6 for update;
a b
3 100
4 100
5 25
6 36
select * from t where a<=2 for update;
a b
1 100
2 100
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
select * from t where a>=2 and a<=4 for update;
a b
2 100
3 100
4 100
update t set b=b where a>=0 and a<=3;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a>=3 and a<=6;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a<=2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a>=5;
commit;
update t set b=b where a>=0 and a<=3;
update t set b=b where a>=3 and a<=6;
update t set b=b where a<=2;
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
update t set b=b where a>=2 and a<=4;
select * from t where a>=0 and a<=3 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=3 and a<=6 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a<=2 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=5 for update;
a b
5 25
6 36
commit;
select * from t where a>=0 and a<=3 for update;
a b
1 100
2 100
3 100
select * from t where a>=3 and a<=6 for update;
a b
3 100
4 100
5 25
6 36
select * from t where a<=2 for update;
a b
1 100
2 100
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
begin;
update t set b=b where a>=2 and a<=4;
update t set b=b where a>=0 and a<=3;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a>=3 and a<=6;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a<=2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a>=5;
commit;
update t set b=b where a>=0 and a<=3;
update t set b=b where a>=3 and a<=6;
update t set b=b where a<=2;
select * from t;
a b
1 100
2 100
3 100
4 100
5 25
6 36
drop table t;
set global tokudb_lock_timeout=30000000;
# test that select for update is executed with serializable isolation
set storage_engine='tokudb';
set global tokudb_lock_timeout=0;
select @@tokudb_lock_timeout;
--disable_warnings
drop table if exists t;
--enable_warnings
create table t (a int primary key, b int);
insert into t values (1,0),(2,0),(3,0),(4,0);
commit;
select @@autocommit;
set autocommit=off;
#set session transaction isolation level read committed;
connect(conn1,localhost,root);
#set session transaction isolation level read committed;
select @@autocommit;
set autocommit=off;
connection default;
# t1 select for update
select * from t where a=1 for update;
connection conn1;
# t2 select for update, should get get lock timeout
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1 for update;
commit;
connection default;
# t1 commit
commit;
set global tokudb_lock_timeout=30000000;
drop table t;
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