Commit e893e518 authored by John Esmet's avatar John Esmet

[t:3453] script now tests that early commits from any pair of competing
transactions allow the blocked contender to proceed without timeout error


git-svn-id: file:///svn/mysql/tests/mysql-test@35031 c7de825b-a66e-492c-adef-691d508d4ae1
parent a5b411f6
......@@ -54,7 +54,7 @@ write_point_queries = [
write_range_queries = [
("select for update", mysqlgen_select_for_update_range),
("update", mysqlgen_update_range) ]
timeouts = ["0", "500000"]
timeouts = [0, 500000]
# Here's where all the magic happens
print "# Tokutek"
......@@ -90,6 +90,22 @@ for timeout in timeouts:
mysqlgen_select_star()
print "connection default;"
print ""
# test early commit
if timeout > 0:
print "# check that an early commit allows a blocked"
print "# transaction to complete"
print "connection default;"
print "begin;"
qa("a", "1", "b", "150")
print "connection conn2;"
# this makes the query asynchronous, so we can jump back
# to the default connection and commit it.
print "send ",
qb("a", "1", "b", "175")
print "connection default;"
print "commit;"
print "connection conn2;"
print "reap;"
# point vs range contention
for rt, rq in write_range_queries:
print "# testing range query \"%s\" vs \"%s\"" % (rt, ta)
......@@ -113,6 +129,22 @@ for timeout in timeouts:
mysqlgen_select_star()
print "connection default;"
print ""
# test early commit
if timeout > 0:
print "# check that an early commit allows a blocked"
print "# transaction to complete"
print "connection default;"
print "begin;"
qa("a", "1", "b", "150")
print "connection conn2;"
# this makes the query asynchronous, so we can jump back
# to the default connection and commit it.
print "send ",
rq("a", "b", "<=2")
print "connection default;"
print "commit;"
print "connection conn2;"
print "reap;"
for rt, rq in write_range_queries:
for rtb, rqb in write_range_queries:
print "# testing range query \"%s\" vs range query \"%s\"" % (rt, rtb)
......@@ -139,4 +171,20 @@ for timeout in timeouts:
mysqlgen_select_star()
print "connection default;"
print ""
# test early commit
if timeout > 0:
print "# check that an early commit allows a blocked"
print "# transaction to complete"
print "connection default;"
print "begin;"
rq("a", "b", ">=2 and a<=4")
print "connection conn2;"
# this makes the query asynchronous, so we can jump back
# to the default connection and commit it.
print "send ",
rqb("a", "b", ">=0 and a<=3")
print "connection default;"
print "commit;"
print "connection conn2;"
print "reap;"
mysqlgen_cleanup()
# Tokutek
# Blocking row lock tests;
# Generated by blocking-row-locks-testgen.py on 2011-09-24;
# Generated by blocking-row-locks-testgen.py on 2011-09-25;
# prepare with some common parameters
set storage_engine=tokudb;
......@@ -573,6 +573,17 @@ select * from t where a=1 for update;
select * from t;
connection default;
# check that an early commit allows a blocked
# transaction to complete
connection default;
begin;
select * from t where a=1 for update;
connection conn2;
send select * from t where a=1 for update;
connection default;
commit;
connection conn2;
reap;
# testing conflict "select for update" vs. "update"
connection default;
begin;
......@@ -591,6 +602,17 @@ update t set b=b where a=1;
select * from t;
connection default;
# check that an early commit allows a blocked
# transaction to complete
connection default;
begin;
select * from t where a=1 for update;
connection conn2;
send update t set b=b where a=1;
connection default;
commit;
connection conn2;
reap;
# testing conflict "select for update" vs. "insert"
connection default;
begin;
......@@ -609,6 +631,17 @@ insert ignore t values(1, 100);
select * from t;
connection default;
# check that an early commit allows a blocked
# transaction to complete
connection default;
begin;
select * from t where a=1 for update;
connection conn2;
send insert ignore t values(1, 175);
connection default;
commit;
connection conn2;
reap;
# testing conflict "select for update" vs. "replace"
connection default;
begin;
......@@ -627,6 +660,17 @@ replace t values(1, 100);
select * from t;
connection default;
# check that an early commit allows a blocked
# transaction to complete
connection default;
begin;
select * from t where a=1 for update;
connection conn2;
send replace t values(1, 175);
connection default;
commit;
connection conn2;
reap;
# testing range query "select for update" vs "select for update"
connection default;
begin;
......@@ -646,6 +690,17 @@ select * from t where a>=0 for update;
select * from t;
connection default;
# check that an early commit allows a blocked
# transaction to complete
connection default;
begin;
select * from t where a=1 for update;
connection conn2;
send select * from t where a<=2 for update;
connection default;
commit;
connection conn2;
reap;
# testing range query "update" vs "select for update"
connection default;
begin;
......@@ -665,6 +720,17 @@ update t set b=b where a>=0;
select * from t;
connection default;
# check that an early commit allows a blocked
# transaction to complete
connection default;
begin;
select * from t where a=1 for update;
connection conn2;
send update t set b=b where a<=2;
connection default;
commit;
connection conn2;
reap;
# testing conflict "update" vs. "select for update"
connection default;
begin;
......@@ -683,6 +749,17 @@ select * from t where a=1 for update;
select * from t;
connection default;
# check that an early commit allows a blocked
# transaction to complete
connection default;
begin;
update t set b=b where a=1;
connection conn2;
send select * from t where a=1 for update;
connection default;
commit;
connection conn2;
reap;
# testing conflict "update" vs. "update"
connection default;
begin;
......@@ -701,6 +778,17 @@ update t set b=b where a=1;
select * from t;
connection default;
# check that an early commit allows a blocked
# transaction to complete
connection default;
begin;
update t set b=b where a=1;
connection conn2;
send update t set b=b where a=1;
connection default;
commit;
connection conn2;
reap;
# testing conflict "update" vs. "insert"
connection default;
begin;
......@@ -719,6 +807,17 @@ insert ignore t values(1, 100);
select * from t;
connection default;
# check that an early commit allows a blocked
# transaction to complete
connection default;
begin;
update t set b=b where a=1;
connection conn2;
send insert ignore t values(1, 175);
connection default;
commit;
connection conn2;
reap;
# testing conflict "update" vs. "replace"
connection default;
begin;
......@@ -737,6 +836,17 @@ replace t values(1, 100);
select * from t;
connection default;
# check that an early commit allows a blocked
# transaction to complete
connection default;
begin;
update t set b=b where a=1;
connection conn2;
send replace t values(1, 175);
connection default;
commit;
connection conn2;
reap;
# testing range query "select for update" vs "update"
connection default;
begin;
......@@ -756,6 +866,17 @@ select * from t where a>=0 for update;
select * from t;
connection default;
# check that an early commit allows a blocked
# transaction to complete
connection default;
begin;
update t set b=b where a=1;
connection conn2;
send select * from t where a<=2 for update;
connection default;
commit;
connection conn2;
reap;
# testing range query "update" vs "update"
connection default;
begin;
......@@ -775,6 +896,17 @@ update t set b=b where a>=0;
select * from t;
connection default;
# check that an early commit allows a blocked
# transaction to complete
connection default;
begin;
update t set b=b where a=1;
connection conn2;
send update t set b=b where a<=2;
connection default;
commit;
connection conn2;
reap;
# testing conflict "insert" vs. "select for update"
connection default;
begin;
......@@ -793,6 +925,17 @@ select * from t where a=1 for update;
select * from t;
connection default;
# check that an early commit allows a blocked
# transaction to complete
connection default;
begin;
insert ignore t values(1, 150);
connection conn2;
send select * from t where a=1 for update;
connection default;
commit;
connection conn2;
reap;
# testing conflict "insert" vs. "update"
connection default;
begin;
......@@ -811,6 +954,17 @@ update t set b=b where a=1;
select * from t;
connection default;
# check that an early commit allows a blocked
# transaction to complete
connection default;
begin;
insert ignore t values(1, 150);
connection conn2;
send update t set b=b where a=1;
connection default;
commit;
connection conn2;
reap;
# testing conflict "insert" vs. "insert"
connection default;
begin;
......@@ -829,6 +983,17 @@ insert ignore t values(1, 100);
select * from t;
connection default;
# check that an early commit allows a blocked
# transaction to complete
connection default;
begin;
insert ignore t values(1, 150);
connection conn2;
send insert ignore t values(1, 175);
connection default;
commit;
connection conn2;
reap;
# testing conflict "insert" vs. "replace"
connection default;
begin;
......@@ -847,6 +1012,17 @@ replace t values(1, 100);
select * from t;
connection default;
# check that an early commit allows a blocked
# transaction to complete
connection default;
begin;
insert ignore t values(1, 150);
connection conn2;
send replace t values(1, 175);
connection default;
commit;
connection conn2;
reap;
# testing range query "select for update" vs "insert"
connection default;
begin;
......@@ -866,6 +1042,17 @@ select * from t where a>=0 for update;
select * from t;
connection default;
# check that an early commit allows a blocked
# transaction to complete
connection default;
begin;
insert ignore t values(1, 150);
connection conn2;
send select * from t where a<=2 for update;
connection default;
commit;
connection conn2;
reap;
# testing range query "update" vs "insert"
connection default;
begin;
......@@ -885,6 +1072,17 @@ update t set b=b where a>=0;
select * from t;
connection default;
# check that an early commit allows a blocked
# transaction to complete
connection default;
begin;
insert ignore t values(1, 150);
connection conn2;
send update t set b=b where a<=2;
connection default;
commit;
connection conn2;
reap;
# testing conflict "replace" vs. "select for update"
connection default;
begin;
......@@ -903,6 +1101,17 @@ select * from t where a=1 for update;
select * from t;
connection default;
# check that an early commit allows a blocked
# transaction to complete
connection default;
begin;
replace t values(1, 150);
connection conn2;
send select * from t where a=1 for update;
connection default;
commit;
connection conn2;
reap;
# testing conflict "replace" vs. "update"
connection default;
begin;
......@@ -921,6 +1130,17 @@ update t set b=b where a=1;
select * from t;
connection default;
# check that an early commit allows a blocked
# transaction to complete
connection default;
begin;
replace t values(1, 150);
connection conn2;
send update t set b=b where a=1;
connection default;
commit;
connection conn2;
reap;
# testing conflict "replace" vs. "insert"
connection default;
begin;
......@@ -939,6 +1159,17 @@ insert ignore t values(1, 100);
select * from t;
connection default;
# check that an early commit allows a blocked
# transaction to complete
connection default;
begin;
replace t values(1, 150);
connection conn2;
send insert ignore t values(1, 175);
connection default;
commit;
connection conn2;
reap;
# testing conflict "replace" vs. "replace"
connection default;
begin;
......@@ -957,6 +1188,17 @@ replace t values(1, 100);
select * from t;
connection default;
# check that an early commit allows a blocked
# transaction to complete
connection default;
begin;
replace t values(1, 150);
connection conn2;
send replace t values(1, 175);
connection default;
commit;
connection conn2;
reap;
# testing range query "select for update" vs "replace"
connection default;
begin;
......@@ -976,6 +1218,17 @@ select * from t where a>=0 for update;
select * from t;
connection default;
# check that an early commit allows a blocked
# transaction to complete
connection default;
begin;
replace t values(1, 150);
connection conn2;
send select * from t where a<=2 for update;
connection default;
commit;
connection conn2;
reap;
# testing range query "update" vs "replace"
connection default;
begin;
......@@ -995,6 +1248,17 @@ update t set b=b where a>=0;
select * from t;
connection default;
# check that an early commit allows a blocked
# transaction to complete
connection default;
begin;
replace t values(1, 150);
connection conn2;
send update t set b=b where a<=2;
connection default;
commit;
connection conn2;
reap;
# testing range query "select for update" vs range query "select for update"
connection default;
begin;
......@@ -1017,6 +1281,17 @@ select * from t where a<=2 for update;
select * from t;
connection default;
# check that an early commit allows a blocked
# transaction to complete
connection default;
begin;
select * from t where a>=2 and a<=4 for update;
connection conn2;
send select * from t where a>=0 and a<=3 for update;
connection default;
commit;
connection conn2;
reap;
# testing range query "select for update" vs range query "update"
connection default;
begin;
......@@ -1039,6 +1314,17 @@ update t set b=b where a<=2;
select * from t;
connection default;
# check that an early commit allows a blocked
# transaction to complete
connection default;
begin;
select * from t where a>=2 and a<=4 for update;
connection conn2;
send update t set b=b where a>=0 and a<=3;
connection default;
commit;
connection conn2;
reap;
# testing range query "update" vs range query "select for update"
connection default;
begin;
......@@ -1061,6 +1347,17 @@ select * from t where a<=2 for update;
select * from t;
connection default;
# check that an early commit allows a blocked
# transaction to complete
connection default;
begin;
update t set b=b where a>=2 and a<=4;
connection conn2;
send select * from t where a>=0 and a<=3 for update;
connection default;
commit;
connection conn2;
reap;
# testing range query "update" vs range query "update"
connection default;
begin;
......@@ -1083,6 +1380,17 @@ update t set b=b where a<=2;
select * from t;
connection default;
# check that an early commit allows a blocked
# transaction to complete
connection default;
begin;
update t set b=b where a>=2 and a<=4;
connection conn2;
send update t set b=b where a>=0 and a<=3;
connection default;
commit;
connection conn2;
reap;
# clean it all up
drop table t;
set global tokudb_lock_timeout=30000000;
......
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