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