Commit 7f9b4864 authored by John Esmet's avatar John Esmet

[t:3453] added tests for reads with serializable transactions, updated

results


git-svn-id: file:///svn/mysql/tests/mysql-test@35052 c7de825b-a66e-492c-adef-691d508d4ae1
parent 587f91c8
......@@ -27,7 +27,9 @@ def mysqlgen_select_where(k, where):
def mysqlgen_prepare():
print "# prepare with some common parameters"
print "connect(conn1, localhost, root);"
print "set session transaction isolation level serializable;"
print "connect(conn2, localhost, root);"
print "set session transaction isolation level serializable;"
print "connection conn1;"
print ""
def mysqlgen_reload_table():
......@@ -79,6 +81,13 @@ for timeout in timeouts:
if k == 1:
print "--error ER_LOCK_WAIT_TIMEOUT"
qb("a", k, "b", "100")
# point write lock vs read query
print "# make sure we can't read that row, but can read others."
print "--error ER_LOCK_WAIT_TIMEOUT"
mysqlgen_select_star()
print "--error ER_LOCK_WAIT_TIMEOUT"
mysqlgen_select_where("a", "=1")
mysqlgen_select_where("a", ">=2")
# Always check in the end that a commit
# allows the other transaction full access
print "connection conn1;"
......@@ -117,6 +126,13 @@ for timeout in timeouts:
print "--error ER_LOCK_WAIT_TIMEOUT"
rq("a", "b", ">=0")
rq("a", "b", ">2")
# write range lock vs read query
print "# make sure we can't read that row, but can read others."
print "--error ER_LOCK_WAIT_TIMEOUT"
mysqlgen_select_star()
print "--error ER_LOCK_WAIT_TIMEOUT"
mysqlgen_select_where("a", "=1")
mysqlgen_select_where("a", ">=2")
# Always check in the end that a commit
# allows the other transaction full access
print "connection conn1;"
......@@ -158,6 +174,15 @@ for timeout in timeouts:
print "--error ER_LOCK_WAIT_TIMEOUT"
rqb("a", "b", "<=2")
rqb("a", "b", ">=5")
# point write lock vs read query
print "# make sure we can't read that row, but can read others."
print "--error ER_LOCK_WAIT_TIMEOUT"
mysqlgen_select_star()
print "--error ER_LOCK_WAIT_TIMEOUT"
mysqlgen_select_where("a", "=2")
print "--error ER_LOCK_WAIT_TIMEOUT"
mysqlgen_select_where("a", ">=3 and a<=5")
mysqlgen_select_where("a", ">=5")
# Always check in the end that a commit
# allows the other transaction full access
print "connection conn1;"
......
set session transaction isolation level serializable;
set session transaction isolation level serializable;
drop table if exists t;
create table t (a int primary key, b int) engine=tokudb;
insert ignore t values(1, 1);
......@@ -22,6 +24,17 @@ a b
select * from t where a=4 for update;
a b
4 16
select * from t;
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 where a>=2;
a b
2 4
3 9
4 16
5 25
6 36
commit;
select * from t where a=1 for update;
a b
......@@ -43,6 +56,17 @@ 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;
select * from t;
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 where a>=2;
a b
2 4
3 9
4 16
5 25
6 36
commit;
update t set b=b where a=1;
select * from t;
......@@ -62,6 +86,17 @@ 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);
select * from t;
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 where a>=2;
a b
2 4
3 9
4 16
5 25
6 36
commit;
insert ignore t values(1, 100);
select * from t;
......@@ -81,6 +116,17 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
replace t values(2, 100);
replace t values(3, 100);
replace t values(4, 100);
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
replace t values(1, 100);
select * from t;
......@@ -105,6 +151,17 @@ a b
4 100
5 25
6 36
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
select * from t where a<=2 for update;
a b
......@@ -135,6 +192,17 @@ 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;
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
update t set b=b where a<=2;
update t set b=b where a>=0;
......@@ -159,6 +227,17 @@ a b
select * from t where a=4 for update;
a b
4 100
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
select * from t where a=1 for update;
a b
......@@ -178,6 +257,17 @@ 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;
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
update t set b=b where a=1;
select * from t;
......@@ -195,6 +285,17 @@ 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);
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
insert ignore t values(1, 100);
select * from t;
......@@ -212,6 +313,17 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
replace t values(2, 100);
replace t values(3, 100);
replace t values(4, 100);
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
replace t values(1, 100);
select * from t;
......@@ -234,6 +346,17 @@ a b
4 100
5 25
6 36
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
select * from t where a<=2 for update;
a b
......@@ -262,6 +385,17 @@ 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;
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
update t set b=b where a<=2;
update t set b=b where a>=0;
......@@ -286,6 +420,17 @@ a b
select * from t where a=4 for update;
a b
4 100
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
select * from t where a=1 for update;
a b
......@@ -305,6 +450,17 @@ 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;
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
update t set b=b where a=1;
select * from t;
......@@ -322,6 +478,17 @@ 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);
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
insert ignore t values(1, 100);
select * from t;
......@@ -339,6 +506,17 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
replace t values(2, 100);
replace t values(3, 100);
replace t values(4, 100);
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
replace t values(1, 100);
select * from t;
......@@ -361,6 +539,17 @@ a b
4 100
5 25
6 36
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
select * from t where a<=2 for update;
a b
......@@ -389,6 +578,17 @@ 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;
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
update t set b=b where a<=2;
update t set b=b where a>=0;
......@@ -413,6 +613,17 @@ a b
select * from t where a=4 for update;
a b
4 100
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
select * from t where a=1 for update;
a b
......@@ -432,6 +643,17 @@ 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;
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
update t set b=b where a=1;
select * from t;
......@@ -449,6 +671,17 @@ 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);
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
insert ignore t values(1, 100);
select * from t;
......@@ -466,6 +699,17 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
replace t values(2, 100);
replace t values(3, 100);
replace t values(4, 100);
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
replace t values(1, 100);
select * from t;
......@@ -488,6 +732,17 @@ a b
4 100
5 25
6 36
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
select * from t where a<=2 for update;
a b
......@@ -516,6 +771,17 @@ 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;
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
update t set b=b where a<=2;
update t set b=b where a>=0;
......@@ -543,6 +809,16 @@ select * from t where a>=5 for update;
a b
5 25
6 36
select * from t;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a=2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=3 and a<=5;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=5;
a b
5 25
6 36
commit;
select * from t where a>=0 and a<=3 for update;
a b
......@@ -580,6 +856,16 @@ 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;
select * from t;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a=2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=3 and a<=5;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=5;
a b
5 25
6 36
commit;
update t set b=b where a>=0 and a<=3;
update t set b=b where a>=3 and a<=6;
......@@ -604,6 +890,16 @@ select * from t where a>=5 for update;
a b
5 25
6 36
select * from t;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a=2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=3 and a<=5;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=5;
a b
5 25
6 36
commit;
select * from t where a>=0 and a<=3 for update;
a b
......@@ -637,6 +933,16 @@ 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;
select * from t;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a=2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=3 and a<=5;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=5;
a b
5 25
6 36
commit;
update t set b=b where a>=0 and a<=3;
update t set b=b where a>=3 and a<=6;
......@@ -665,6 +971,17 @@ a b
select * from t where a=4 for update;
a b
4 100
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
select * from t where a=1 for update;
a b
......@@ -694,6 +1011,17 @@ 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;
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
update t set b=b where a=1;
select * from t;
......@@ -719,6 +1047,17 @@ 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);
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
insert ignore t values(1, 100);
select * from t;
......@@ -744,6 +1083,17 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
replace t values(2, 100);
replace t values(3, 100);
replace t values(4, 100);
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
replace t values(1, 100);
select * from t;
......@@ -774,6 +1124,17 @@ a b
4 100
5 25
6 36
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
select * from t where a<=2 for update;
a b
......@@ -813,6 +1174,17 @@ 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;
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
update t set b=b where a<=2;
update t set b=b where a>=0;
......@@ -843,6 +1215,17 @@ a b
select * from t where a=4 for update;
a b
4 100
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
select * from t where a=1 for update;
a b
......@@ -868,6 +1251,17 @@ 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;
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
update t set b=b where a=1;
select * from t;
......@@ -889,6 +1283,17 @@ 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);
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
insert ignore t values(1, 100);
select * from t;
......@@ -910,6 +1315,17 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
replace t values(2, 100);
replace t values(3, 100);
replace t values(4, 100);
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
replace t values(1, 100);
select * from t;
......@@ -936,6 +1352,17 @@ a b
4 100
5 25
6 36
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
select * from t where a<=2 for update;
a b
......@@ -971,6 +1398,17 @@ 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;
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
update t set b=b where a<=2;
update t set b=b where a>=0;
......@@ -999,6 +1437,17 @@ a b
select * from t where a=4 for update;
a b
4 100
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
select * from t where a=1 for update;
a b
......@@ -1024,6 +1473,17 @@ 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;
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
update t set b=b where a=1;
select * from t;
......@@ -1045,6 +1505,17 @@ 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);
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
insert ignore t values(1, 100);
select * from t;
......@@ -1066,6 +1537,17 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
replace t values(2, 100);
replace t values(3, 100);
replace t values(4, 100);
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
replace t values(1, 100);
select * from t;
......@@ -1092,6 +1574,17 @@ a b
4 100
5 25
6 36
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
select * from t where a<=2 for update;
a b
......@@ -1127,6 +1620,17 @@ 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;
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
update t set b=b where a<=2;
update t set b=b where a>=0;
......@@ -1155,6 +1659,17 @@ a b
select * from t where a=4 for update;
a b
4 100
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
select * from t where a=1 for update;
a b
......@@ -1180,6 +1695,17 @@ 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;
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
update t set b=b where a=1;
select * from t;
......@@ -1201,6 +1727,17 @@ 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);
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
insert ignore t values(1, 100);
select * from t;
......@@ -1222,6 +1759,17 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
replace t values(2, 100);
replace t values(3, 100);
replace t values(4, 100);
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
replace t values(1, 100);
select * from t;
......@@ -1248,6 +1796,17 @@ a b
4 100
5 25
6 36
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
select * from t where a<=2 for update;
a b
......@@ -1283,6 +1842,17 @@ 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;
select * from t;
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 where a>=2;
a b
2 100
3 100
4 100
5 25
6 36
commit;
update t set b=b where a<=2;
update t set b=b where a>=0;
......@@ -1314,6 +1884,16 @@ select * from t where a>=5 for update;
a b
5 25
6 36
select * from t;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a=2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=3 and a<=5;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=5;
a b
5 25
6 36
commit;
select * from t where a>=0 and a<=3 for update;
a b
......@@ -1363,6 +1943,16 @@ 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;
select * from t;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a=2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=3 and a<=5;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=5;
a b
5 25
6 36
commit;
update t set b=b where a>=0 and a<=3;
update t set b=b where a>=3 and a<=6;
......@@ -1395,6 +1985,16 @@ select * from t where a>=5 for update;
a b
5 25
6 36
select * from t;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a=2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=3 and a<=5;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=5;
a b
5 25
6 36
commit;
select * from t where a>=0 and a<=3 for update;
a b
......@@ -1436,6 +2036,16 @@ 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;
select * from t;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a=2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=3 and a<=5;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=5;
a b
5 25
6 36
commit;
update t set b=b where a>=0 and a<=3;
update t set b=b where a>=3 and a<=6;
......
......@@ -4,7 +4,9 @@
# prepare with some common parameters
connect(conn1, localhost, root);
set session transaction isolation level serializable;
connect(conn2, localhost, root);
set session transaction isolation level serializable;
connection conn1;
# drop old table, generate new one. 4 rows
......@@ -34,6 +36,12 @@ select * from t where a=1 for update;
select * from t where a=2 for update;
select * from t where a=3 for update;
select * from t where a=4 for update;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -52,6 +60,12 @@ update t set b=b where a=1;
update t set b=b where a=2;
update t set b=b where a=3;
update t set b=b where a=4;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -70,6 +84,12 @@ insert ignore t values(1, 100);
insert ignore t values(2, 100);
insert ignore t values(3, 100);
insert ignore t values(4, 100);
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -88,6 +108,12 @@ replace t values(1, 100);
replace t values(2, 100);
replace t values(3, 100);
replace t values(4, 100);
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -106,6 +132,12 @@ select * from t where a<=2 for update;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a>=0 for update;
select * from t where a>2 for update;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -125,6 +157,12 @@ update t set b=b where a<=2;
--error ER_LOCK_WAIT_TIMEOUT
update t set b=b where a>=0;
update t set b=b where a>2;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -144,6 +182,12 @@ select * from t where a=1 for update;
select * from t where a=2 for update;
select * from t where a=3 for update;
select * from t where a=4 for update;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -162,6 +206,12 @@ update t set b=b where a=1;
update t set b=b where a=2;
update t set b=b where a=3;
update t set b=b where a=4;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -180,6 +230,12 @@ insert ignore t values(1, 100);
insert ignore t values(2, 100);
insert ignore t values(3, 100);
insert ignore t values(4, 100);
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -198,6 +254,12 @@ replace t values(1, 100);
replace t values(2, 100);
replace t values(3, 100);
replace t values(4, 100);
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -216,6 +278,12 @@ select * from t where a<=2 for update;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a>=0 for update;
select * from t where a>2 for update;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -235,6 +303,12 @@ update t set b=b where a<=2;
--error ER_LOCK_WAIT_TIMEOUT
update t set b=b where a>=0;
update t set b=b where a>2;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -254,6 +328,12 @@ select * from t where a=1 for update;
select * from t where a=2 for update;
select * from t where a=3 for update;
select * from t where a=4 for update;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -272,6 +352,12 @@ update t set b=b where a=1;
update t set b=b where a=2;
update t set b=b where a=3;
update t set b=b where a=4;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -290,6 +376,12 @@ insert ignore t values(1, 100);
insert ignore t values(2, 100);
insert ignore t values(3, 100);
insert ignore t values(4, 100);
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -308,6 +400,12 @@ replace t values(1, 100);
replace t values(2, 100);
replace t values(3, 100);
replace t values(4, 100);
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -326,6 +424,12 @@ select * from t where a<=2 for update;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a>=0 for update;
select * from t where a>2 for update;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -345,6 +449,12 @@ update t set b=b where a<=2;
--error ER_LOCK_WAIT_TIMEOUT
update t set b=b where a>=0;
update t set b=b where a>2;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -364,6 +474,12 @@ select * from t where a=1 for update;
select * from t where a=2 for update;
select * from t where a=3 for update;
select * from t where a=4 for update;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -382,6 +498,12 @@ update t set b=b where a=1;
update t set b=b where a=2;
update t set b=b where a=3;
update t set b=b where a=4;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -400,6 +522,12 @@ insert ignore t values(1, 100);
insert ignore t values(2, 100);
insert ignore t values(3, 100);
insert ignore t values(4, 100);
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -418,6 +546,12 @@ replace t values(1, 100);
replace t values(2, 100);
replace t values(3, 100);
replace t values(4, 100);
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -436,6 +570,12 @@ select * from t where a<=2 for update;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a>=0 for update;
select * from t where a>2 for update;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -455,6 +595,12 @@ update t set b=b where a<=2;
--error ER_LOCK_WAIT_TIMEOUT
update t set b=b where a>=0;
update t set b=b where a>2;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -476,6 +622,14 @@ select * from t where a>=3 and a<=6 for update;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a<=2 for update;
select * from t where a>=5 for update;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=2;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a>=3 and a<=5;
select * from t where a>=5;
connection conn1;
commit;
connection conn2;
......@@ -498,6 +652,14 @@ update t set b=b where a>=3 and a<=6;
--error ER_LOCK_WAIT_TIMEOUT
update t set b=b where a<=2;
update t set b=b where a>=5;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=2;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a>=3 and a<=5;
select * from t where a>=5;
connection conn1;
commit;
connection conn2;
......@@ -520,6 +682,14 @@ select * from t where a>=3 and a<=6 for update;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a<=2 for update;
select * from t where a>=5 for update;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=2;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a>=3 and a<=5;
select * from t where a>=5;
connection conn1;
commit;
connection conn2;
......@@ -542,6 +712,14 @@ update t set b=b where a>=3 and a<=6;
--error ER_LOCK_WAIT_TIMEOUT
update t set b=b where a<=2;
update t set b=b where a>=5;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=2;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a>=3 and a<=5;
select * from t where a>=5;
connection conn1;
commit;
connection conn2;
......@@ -566,6 +744,12 @@ select * from t where a=1 for update;
select * from t where a=2 for update;
select * from t where a=3 for update;
select * from t where a=4 for update;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -595,6 +779,12 @@ update t set b=b where a=1;
update t set b=b where a=2;
update t set b=b where a=3;
update t set b=b where a=4;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -624,6 +814,12 @@ insert ignore t values(1, 100);
insert ignore t values(2, 100);
insert ignore t values(3, 100);
insert ignore t values(4, 100);
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -653,6 +849,12 @@ replace t values(1, 100);
replace t values(2, 100);
replace t values(3, 100);
replace t values(4, 100);
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -682,6 +884,12 @@ select * from t where a<=2 for update;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a>=0 for update;
select * from t where a>2 for update;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -712,6 +920,12 @@ update t set b=b where a<=2;
--error ER_LOCK_WAIT_TIMEOUT
update t set b=b where a>=0;
update t set b=b where a>2;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -742,6 +956,12 @@ select * from t where a=1 for update;
select * from t where a=2 for update;
select * from t where a=3 for update;
select * from t where a=4 for update;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -771,6 +991,12 @@ update t set b=b where a=1;
update t set b=b where a=2;
update t set b=b where a=3;
update t set b=b where a=4;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -800,6 +1026,12 @@ insert ignore t values(1, 100);
insert ignore t values(2, 100);
insert ignore t values(3, 100);
insert ignore t values(4, 100);
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -829,6 +1061,12 @@ replace t values(1, 100);
replace t values(2, 100);
replace t values(3, 100);
replace t values(4, 100);
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -858,6 +1096,12 @@ select * from t where a<=2 for update;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a>=0 for update;
select * from t where a>2 for update;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -888,6 +1132,12 @@ update t set b=b where a<=2;
--error ER_LOCK_WAIT_TIMEOUT
update t set b=b where a>=0;
update t set b=b where a>2;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -918,6 +1168,12 @@ select * from t where a=1 for update;
select * from t where a=2 for update;
select * from t where a=3 for update;
select * from t where a=4 for update;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -947,6 +1203,12 @@ update t set b=b where a=1;
update t set b=b where a=2;
update t set b=b where a=3;
update t set b=b where a=4;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -976,6 +1238,12 @@ insert ignore t values(1, 100);
insert ignore t values(2, 100);
insert ignore t values(3, 100);
insert ignore t values(4, 100);
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -1005,6 +1273,12 @@ replace t values(1, 100);
replace t values(2, 100);
replace t values(3, 100);
replace t values(4, 100);
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -1034,6 +1308,12 @@ select * from t where a<=2 for update;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a>=0 for update;
select * from t where a>2 for update;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -1064,6 +1344,12 @@ update t set b=b where a<=2;
--error ER_LOCK_WAIT_TIMEOUT
update t set b=b where a>=0;
update t set b=b where a>2;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -1094,6 +1380,12 @@ select * from t where a=1 for update;
select * from t where a=2 for update;
select * from t where a=3 for update;
select * from t where a=4 for update;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -1123,6 +1415,12 @@ update t set b=b where a=1;
update t set b=b where a=2;
update t set b=b where a=3;
update t set b=b where a=4;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -1152,6 +1450,12 @@ insert ignore t values(1, 100);
insert ignore t values(2, 100);
insert ignore t values(3, 100);
insert ignore t values(4, 100);
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -1181,6 +1485,12 @@ replace t values(1, 100);
replace t values(2, 100);
replace t values(3, 100);
replace t values(4, 100);
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -1210,6 +1520,12 @@ select * from t where a<=2 for update;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a>=0 for update;
select * from t where a>2 for update;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -1240,6 +1556,12 @@ update t set b=b where a<=2;
--error ER_LOCK_WAIT_TIMEOUT
update t set b=b where a>=0;
update t set b=b where a>2;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1;
select * from t where a>=2;
connection conn1;
commit;
connection conn2;
......@@ -1272,6 +1594,14 @@ select * from t where a>=3 and a<=6 for update;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a<=2 for update;
select * from t where a>=5 for update;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=2;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a>=3 and a<=5;
select * from t where a>=5;
connection conn1;
commit;
connection conn2;
......@@ -1305,6 +1635,14 @@ update t set b=b where a>=3 and a<=6;
--error ER_LOCK_WAIT_TIMEOUT
update t set b=b where a<=2;
update t set b=b where a>=5;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=2;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a>=3 and a<=5;
select * from t where a>=5;
connection conn1;
commit;
connection conn2;
......@@ -1338,6 +1676,14 @@ select * from t where a>=3 and a<=6 for update;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a<=2 for update;
select * from t where a>=5 for update;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=2;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a>=3 and a<=5;
select * from t where a>=5;
connection conn1;
commit;
connection conn2;
......@@ -1371,6 +1717,14 @@ update t set b=b where a>=3 and a<=6;
--error ER_LOCK_WAIT_TIMEOUT
update t set b=b where a<=2;
update t set b=b where a>=5;
# make sure we can't read that row, but can read others.
--error ER_LOCK_WAIT_TIMEOUT
select * from t;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=2;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a>=3 and a<=5;
select * from t where a>=5;
connection conn1;
commit;
connection conn2;
......
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