Commit 587f91c8 authored by John Esmet's avatar John Esmet

[t:3453] cleaned up getset blocking row lock test, removed race test,

since the writewrite-conflict scrip tests the race condition already.
pushed modified scripts and results file.


git-svn-id: file:///svn/mysql/tests/mysql-test@35051 c7de825b-a66e-492c-adef-691d508d4ae1
parent 21a6c7d3
......@@ -26,18 +26,16 @@ def mysqlgen_select_where(k, where):
# mysql test code generation
def mysqlgen_prepare():
print "# prepare with some common parameters"
print "set storage_engine=tokudb;"
#print "connect(conn1, localhost, root);"
#print "set autocommit=off;"
print "connect(conn1, localhost, root);"
print "connect(conn2, localhost, root);"
print "connection default;"
print "connection conn1;"
print ""
def mysqlgen_reload_table():
print "# drop old table, generate new one. 4 rows"
print "--disable_warnings"
print "drop table if exists t;"
print "--enable_warnings"
print "create table t (a int primary key, b int);"
print "create table t (a int primary key, b int) engine=tokudb;"
for i in range(1, 7):
mysqlgen_insert_ignore("a", i, "b", i*i)
print ""
......@@ -72,7 +70,7 @@ for timeout in timeouts:
# point vs point contention
for tb, qb in write_point_queries:
print "# testing conflict \"%s\" vs. \"%s\"" % (ta, tb)
print "connection default;"
print "connection conn1;"
print "begin;"
print ""
qa("a", "1", "b", "100")
......@@ -83,33 +81,33 @@ for timeout in timeouts:
qb("a", k, "b", "100")
# Always check in the end that a commit
# allows the other transaction full access
print "connection default;"
print "connection conn1;"
print "commit;"
print "connection conn2;"
qb("a", "1", "b", "100")
mysqlgen_select_star()
print "connection default;"
print "connection conn1;"
print ""
# test early commit
if timeout > 0:
print "# check that an early commit allows a blocked"
print "# transaction to complete"
print "connection default;"
print "connection conn1;"
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.
# to the conn1 connection and commit it.
print "send ",
qb("a", "1", "b", "175")
print "connection default;"
print "connection conn1;"
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)
print "connection default;"
print "connection conn1;"
print "begin;"
print ""
qa("a", "1", "b", "100")
......@@ -121,34 +119,34 @@ for timeout in timeouts:
rq("a", "b", ">2")
# Always check in the end that a commit
# allows the other transaction full access
print "connection default;"
print "connection conn1;"
print "commit;"
print "connection conn2;"
rq("a", "b", "<=2")
rq("a", "b", ">=0")
mysqlgen_select_star()
print "connection default;"
print "connection conn1;"
print ""
# test early commit
if timeout > 0:
print "# check that an early commit allows a blocked"
print "# transaction to complete"
print "connection default;"
print "connection conn1;"
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.
# to the conn1 connection and commit it.
print "send ",
rq("a", "b", "<=2")
print "connection default;"
print "connection conn1;"
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)
print "connection default;"
print "connection conn1;"
print "begin;"
print ""
rq("a", "b", ">=2 and a<=4")
......@@ -162,28 +160,28 @@ for timeout in timeouts:
rqb("a", "b", ">=5")
# Always check in the end that a commit
# allows the other transaction full access
print "connection default;"
print "connection conn1;"
print "commit;"
print "connection conn2;"
rqb("a", "b", ">=0 and a<=3")
rqb("a", "b", ">=3 and a<=6")
rqb("a", "b", "<=2")
mysqlgen_select_star()
print "connection default;"
print "connection conn1;"
print ""
# test early commit
if timeout > 0:
print "# check that an early commit allows a blocked"
print "# transaction to complete"
print "connection default;"
print "connection conn1;"
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.
# to the conn1 connection and commit it.
print "send ",
rqb("a", "b", ">=0 and a<=3")
print "connection default;"
print "connection conn1;"
print "commit;"
print "connection conn2;"
print "reap;"
......
set storage_engine='tokudb';
select @@tokudb_lock_timeout;
@@tokudb_lock_timeout
30000000
......
set storage_engine=tokudb;
drop table if exists t;
create table t (a int primary key, b int);
create table t (a int primary key, b int) engine=tokudb;
insert ignore t values(1, 1);
insert ignore t values(2, 4);
insert ignore t values(3, 9);
......
......@@ -2,8 +2,6 @@
# Test that getting and setting the value for
# blocking row lock timeout works correctly.
set storage_engine='tokudb';
# Make sure we can read/write the global lock timeout system variable
select @@tokudb_lock_timeout;
set global tokudb_lock_timeout=1234567;
......
# test that select for update is executed with serializable isolation
set storage_engine='tokudb';
set global tokudb_lock_timeout=0;
select @@tokudb_lock_timeout;
--disable_warnings
drop table if exists t;
--enable_warnings
create table t (a int primary key, b int);
insert into t values (1,0),(2,0),(3,0),(4,0);
commit;
select @@autocommit;
set autocommit=off;
#set session transaction isolation level read committed;
connect(conn1,localhost,root);
#set session transaction isolation level read committed;
select @@autocommit;
set autocommit=off;
connection default;
# t1 select for update
select * from t where a=1 for update;
connection conn1;
# t2 select for update, should get get lock timeout
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a=1 for update;
commit;
connection default;
# t1 commit
commit;
set global tokudb_lock_timeout=30000000;
drop table t;
# Tokutek
# Blocking row lock tests;
# Generated by blocking-row-locks-testgen.py on 2011-09-25;
# Generated by blocking-row-locks-testgen.py on 2011-09-26;
# prepare with some common parameters
set storage_engine=tokudb;
connect(conn1, localhost, root);
connect(conn2, localhost, root);
connection default;
connection conn1;
# drop old table, generate new one. 4 rows
--disable_warnings
drop table if exists t;
--enable_warnings
create table t (a int primary key, b int);
create table t (a int primary key, b int) engine=tokudb;
insert ignore t values(1, 1);
insert ignore t values(2, 4);
insert ignore t values(3, 9);
......@@ -24,7 +24,7 @@ set global tokudb_lock_timeout=0;
# testing each point query vs each point query
# testing conflict "select for update" vs. "select for update"
connection default;
connection conn1;
begin;
select * from t where a=1 for update;
......@@ -34,15 +34,15 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
select * from t where a=1 for update;
select * from t;
connection default;
connection conn1;
# testing conflict "select for update" vs. "update"
connection default;
connection conn1;
begin;
select * from t where a=1 for update;
......@@ -52,15 +52,15 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
update t set b=b where a=1;
select * from t;
connection default;
connection conn1;
# testing conflict "select for update" vs. "insert"
connection default;
connection conn1;
begin;
select * from t where a=1 for update;
......@@ -70,15 +70,15 @@ insert ignore t values(1, 100);
insert ignore t values(2, 100);
insert ignore t values(3, 100);
insert ignore t values(4, 100);
connection default;
connection conn1;
commit;
connection conn2;
insert ignore t values(1, 100);
select * from t;
connection default;
connection conn1;
# testing conflict "select for update" vs. "replace"
connection default;
connection conn1;
begin;
select * from t where a=1 for update;
......@@ -88,15 +88,15 @@ replace t values(1, 100);
replace t values(2, 100);
replace t values(3, 100);
replace t values(4, 100);
connection default;
connection conn1;
commit;
connection conn2;
replace t values(1, 100);
select * from t;
connection default;
connection conn1;
# testing range query "select for update" vs "select for update"
connection default;
connection conn1;
begin;
select * from t where a=1 for update;
......@@ -106,16 +106,16 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
select * from t where a<=2 for update;
select * from t where a>=0 for update;
select * from t;
connection default;
connection conn1;
# testing range query "update" vs "select for update"
connection default;
connection conn1;
begin;
select * from t where a=1 for update;
......@@ -125,16 +125,16 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
update t set b=b where a<=2;
update t set b=b where a>=0;
select * from t;
connection default;
connection conn1;
# testing conflict "update" vs. "select for update"
connection default;
connection conn1;
begin;
update t set b=b where a=1;
......@@ -144,15 +144,15 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
select * from t where a=1 for update;
select * from t;
connection default;
connection conn1;
# testing conflict "update" vs. "update"
connection default;
connection conn1;
begin;
update t set b=b where a=1;
......@@ -162,15 +162,15 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
update t set b=b where a=1;
select * from t;
connection default;
connection conn1;
# testing conflict "update" vs. "insert"
connection default;
connection conn1;
begin;
update t set b=b where a=1;
......@@ -180,15 +180,15 @@ insert ignore t values(1, 100);
insert ignore t values(2, 100);
insert ignore t values(3, 100);
insert ignore t values(4, 100);
connection default;
connection conn1;
commit;
connection conn2;
insert ignore t values(1, 100);
select * from t;
connection default;
connection conn1;
# testing conflict "update" vs. "replace"
connection default;
connection conn1;
begin;
update t set b=b where a=1;
......@@ -198,15 +198,15 @@ replace t values(1, 100);
replace t values(2, 100);
replace t values(3, 100);
replace t values(4, 100);
connection default;
connection conn1;
commit;
connection conn2;
replace t values(1, 100);
select * from t;
connection default;
connection conn1;
# testing range query "select for update" vs "update"
connection default;
connection conn1;
begin;
update t set b=b where a=1;
......@@ -216,16 +216,16 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
select * from t where a<=2 for update;
select * from t where a>=0 for update;
select * from t;
connection default;
connection conn1;
# testing range query "update" vs "update"
connection default;
connection conn1;
begin;
update t set b=b where a=1;
......@@ -235,16 +235,16 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
update t set b=b where a<=2;
update t set b=b where a>=0;
select * from t;
connection default;
connection conn1;
# testing conflict "insert" vs. "select for update"
connection default;
connection conn1;
begin;
insert ignore t values(1, 100);
......@@ -254,15 +254,15 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
select * from t where a=1 for update;
select * from t;
connection default;
connection conn1;
# testing conflict "insert" vs. "update"
connection default;
connection conn1;
begin;
insert ignore t values(1, 100);
......@@ -272,15 +272,15 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
update t set b=b where a=1;
select * from t;
connection default;
connection conn1;
# testing conflict "insert" vs. "insert"
connection default;
connection conn1;
begin;
insert ignore t values(1, 100);
......@@ -290,15 +290,15 @@ insert ignore t values(1, 100);
insert ignore t values(2, 100);
insert ignore t values(3, 100);
insert ignore t values(4, 100);
connection default;
connection conn1;
commit;
connection conn2;
insert ignore t values(1, 100);
select * from t;
connection default;
connection conn1;
# testing conflict "insert" vs. "replace"
connection default;
connection conn1;
begin;
insert ignore t values(1, 100);
......@@ -308,15 +308,15 @@ replace t values(1, 100);
replace t values(2, 100);
replace t values(3, 100);
replace t values(4, 100);
connection default;
connection conn1;
commit;
connection conn2;
replace t values(1, 100);
select * from t;
connection default;
connection conn1;
# testing range query "select for update" vs "insert"
connection default;
connection conn1;
begin;
insert ignore t values(1, 100);
......@@ -326,16 +326,16 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
select * from t where a<=2 for update;
select * from t where a>=0 for update;
select * from t;
connection default;
connection conn1;
# testing range query "update" vs "insert"
connection default;
connection conn1;
begin;
insert ignore t values(1, 100);
......@@ -345,16 +345,16 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
update t set b=b where a<=2;
update t set b=b where a>=0;
select * from t;
connection default;
connection conn1;
# testing conflict "replace" vs. "select for update"
connection default;
connection conn1;
begin;
replace t values(1, 100);
......@@ -364,15 +364,15 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
select * from t where a=1 for update;
select * from t;
connection default;
connection conn1;
# testing conflict "replace" vs. "update"
connection default;
connection conn1;
begin;
replace t values(1, 100);
......@@ -382,15 +382,15 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
update t set b=b where a=1;
select * from t;
connection default;
connection conn1;
# testing conflict "replace" vs. "insert"
connection default;
connection conn1;
begin;
replace t values(1, 100);
......@@ -400,15 +400,15 @@ insert ignore t values(1, 100);
insert ignore t values(2, 100);
insert ignore t values(3, 100);
insert ignore t values(4, 100);
connection default;
connection conn1;
commit;
connection conn2;
insert ignore t values(1, 100);
select * from t;
connection default;
connection conn1;
# testing conflict "replace" vs. "replace"
connection default;
connection conn1;
begin;
replace t values(1, 100);
......@@ -418,15 +418,15 @@ replace t values(1, 100);
replace t values(2, 100);
replace t values(3, 100);
replace t values(4, 100);
connection default;
connection conn1;
commit;
connection conn2;
replace t values(1, 100);
select * from t;
connection default;
connection conn1;
# testing range query "select for update" vs "replace"
connection default;
connection conn1;
begin;
replace t values(1, 100);
......@@ -436,16 +436,16 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
select * from t where a<=2 for update;
select * from t where a>=0 for update;
select * from t;
connection default;
connection conn1;
# testing range query "update" vs "replace"
connection default;
connection conn1;
begin;
replace t values(1, 100);
......@@ -455,16 +455,16 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
update t set b=b where a<=2;
update t set b=b where a>=0;
select * from t;
connection default;
connection conn1;
# testing range query "select for update" vs range query "select for update"
connection default;
connection conn1;
begin;
select * from t where a>=2 and a<=4 for update;
......@@ -476,17 +476,17 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
select * from t where a>=0 and a<=3 for update;
select * from t where a>=3 and a<=6 for update;
select * from t where a<=2 for update;
select * from t;
connection default;
connection conn1;
# testing range query "select for update" vs range query "update"
connection default;
connection conn1;
begin;
select * from t where a>=2 and a<=4 for update;
......@@ -498,17 +498,17 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
update t set b=b where a>=0 and a<=3;
update t set b=b where a>=3 and a<=6;
update t set b=b where a<=2;
select * from t;
connection default;
connection conn1;
# testing range query "update" vs range query "select for update"
connection default;
connection conn1;
begin;
update t set b=b where a>=2 and a<=4;
......@@ -520,17 +520,17 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
select * from t where a>=0 and a<=3 for update;
select * from t where a>=3 and a<=6 for update;
select * from t where a<=2 for update;
select * from t;
connection default;
connection conn1;
# testing range query "update" vs range query "update"
connection default;
connection conn1;
begin;
update t set b=b where a>=2 and a<=4;
......@@ -542,21 +542,21 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
update t set b=b where a>=0 and a<=3;
update t set b=b where a>=3 and a<=6;
update t set b=b where a<=2;
select * from t;
connection default;
connection conn1;
# testing with timeout 500000
set global tokudb_lock_timeout=500000;
# testing each point query vs each point query
# testing conflict "select for update" vs. "select for update"
connection default;
connection conn1;
begin;
select * from t where a=1 for update;
......@@ -566,26 +566,26 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
select * from t where a=1 for update;
select * from t;
connection default;
connection conn1;
# check that an early commit allows a blocked
# transaction to complete
connection default;
connection conn1;
begin;
select * from t where a=1 for update;
connection conn2;
send select * from t where a=1 for update;
connection default;
connection conn1;
commit;
connection conn2;
reap;
# testing conflict "select for update" vs. "update"
connection default;
connection conn1;
begin;
select * from t where a=1 for update;
......@@ -595,26 +595,26 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
update t set b=b where a=1;
select * from t;
connection default;
connection conn1;
# check that an early commit allows a blocked
# transaction to complete
connection default;
connection conn1;
begin;
select * from t where a=1 for update;
connection conn2;
send update t set b=b where a=1;
connection default;
connection conn1;
commit;
connection conn2;
reap;
# testing conflict "select for update" vs. "insert"
connection default;
connection conn1;
begin;
select * from t where a=1 for update;
......@@ -624,26 +624,26 @@ insert ignore t values(1, 100);
insert ignore t values(2, 100);
insert ignore t values(3, 100);
insert ignore t values(4, 100);
connection default;
connection conn1;
commit;
connection conn2;
insert ignore t values(1, 100);
select * from t;
connection default;
connection conn1;
# check that an early commit allows a blocked
# transaction to complete
connection default;
connection conn1;
begin;
select * from t where a=1 for update;
connection conn2;
send insert ignore t values(1, 175);
connection default;
connection conn1;
commit;
connection conn2;
reap;
# testing conflict "select for update" vs. "replace"
connection default;
connection conn1;
begin;
select * from t where a=1 for update;
......@@ -653,26 +653,26 @@ replace t values(1, 100);
replace t values(2, 100);
replace t values(3, 100);
replace t values(4, 100);
connection default;
connection conn1;
commit;
connection conn2;
replace t values(1, 100);
select * from t;
connection default;
connection conn1;
# check that an early commit allows a blocked
# transaction to complete
connection default;
connection conn1;
begin;
select * from t where a=1 for update;
connection conn2;
send replace t values(1, 175);
connection default;
connection conn1;
commit;
connection conn2;
reap;
# testing range query "select for update" vs "select for update"
connection default;
connection conn1;
begin;
select * from t where a=1 for update;
......@@ -682,27 +682,27 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
select * from t where a<=2 for update;
select * from t where a>=0 for update;
select * from t;
connection default;
connection conn1;
# check that an early commit allows a blocked
# transaction to complete
connection default;
connection conn1;
begin;
select * from t where a=1 for update;
connection conn2;
send select * from t where a<=2 for update;
connection default;
connection conn1;
commit;
connection conn2;
reap;
# testing range query "update" vs "select for update"
connection default;
connection conn1;
begin;
select * from t where a=1 for update;
......@@ -712,27 +712,27 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
update t set b=b where a<=2;
update t set b=b where a>=0;
select * from t;
connection default;
connection conn1;
# check that an early commit allows a blocked
# transaction to complete
connection default;
connection conn1;
begin;
select * from t where a=1 for update;
connection conn2;
send update t set b=b where a<=2;
connection default;
connection conn1;
commit;
connection conn2;
reap;
# testing conflict "update" vs. "select for update"
connection default;
connection conn1;
begin;
update t set b=b where a=1;
......@@ -742,26 +742,26 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
select * from t where a=1 for update;
select * from t;
connection default;
connection conn1;
# check that an early commit allows a blocked
# transaction to complete
connection default;
connection conn1;
begin;
update t set b=b where a=1;
connection conn2;
send select * from t where a=1 for update;
connection default;
connection conn1;
commit;
connection conn2;
reap;
# testing conflict "update" vs. "update"
connection default;
connection conn1;
begin;
update t set b=b where a=1;
......@@ -771,26 +771,26 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
update t set b=b where a=1;
select * from t;
connection default;
connection conn1;
# check that an early commit allows a blocked
# transaction to complete
connection default;
connection conn1;
begin;
update t set b=b where a=1;
connection conn2;
send update t set b=b where a=1;
connection default;
connection conn1;
commit;
connection conn2;
reap;
# testing conflict "update" vs. "insert"
connection default;
connection conn1;
begin;
update t set b=b where a=1;
......@@ -800,26 +800,26 @@ insert ignore t values(1, 100);
insert ignore t values(2, 100);
insert ignore t values(3, 100);
insert ignore t values(4, 100);
connection default;
connection conn1;
commit;
connection conn2;
insert ignore t values(1, 100);
select * from t;
connection default;
connection conn1;
# check that an early commit allows a blocked
# transaction to complete
connection default;
connection conn1;
begin;
update t set b=b where a=1;
connection conn2;
send insert ignore t values(1, 175);
connection default;
connection conn1;
commit;
connection conn2;
reap;
# testing conflict "update" vs. "replace"
connection default;
connection conn1;
begin;
update t set b=b where a=1;
......@@ -829,26 +829,26 @@ replace t values(1, 100);
replace t values(2, 100);
replace t values(3, 100);
replace t values(4, 100);
connection default;
connection conn1;
commit;
connection conn2;
replace t values(1, 100);
select * from t;
connection default;
connection conn1;
# check that an early commit allows a blocked
# transaction to complete
connection default;
connection conn1;
begin;
update t set b=b where a=1;
connection conn2;
send replace t values(1, 175);
connection default;
connection conn1;
commit;
connection conn2;
reap;
# testing range query "select for update" vs "update"
connection default;
connection conn1;
begin;
update t set b=b where a=1;
......@@ -858,27 +858,27 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
select * from t where a<=2 for update;
select * from t where a>=0 for update;
select * from t;
connection default;
connection conn1;
# check that an early commit allows a blocked
# transaction to complete
connection default;
connection conn1;
begin;
update t set b=b where a=1;
connection conn2;
send select * from t where a<=2 for update;
connection default;
connection conn1;
commit;
connection conn2;
reap;
# testing range query "update" vs "update"
connection default;
connection conn1;
begin;
update t set b=b where a=1;
......@@ -888,27 +888,27 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
update t set b=b where a<=2;
update t set b=b where a>=0;
select * from t;
connection default;
connection conn1;
# check that an early commit allows a blocked
# transaction to complete
connection default;
connection conn1;
begin;
update t set b=b where a=1;
connection conn2;
send update t set b=b where a<=2;
connection default;
connection conn1;
commit;
connection conn2;
reap;
# testing conflict "insert" vs. "select for update"
connection default;
connection conn1;
begin;
insert ignore t values(1, 100);
......@@ -918,26 +918,26 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
select * from t where a=1 for update;
select * from t;
connection default;
connection conn1;
# check that an early commit allows a blocked
# transaction to complete
connection default;
connection conn1;
begin;
insert ignore t values(1, 150);
connection conn2;
send select * from t where a=1 for update;
connection default;
connection conn1;
commit;
connection conn2;
reap;
# testing conflict "insert" vs. "update"
connection default;
connection conn1;
begin;
insert ignore t values(1, 100);
......@@ -947,26 +947,26 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
update t set b=b where a=1;
select * from t;
connection default;
connection conn1;
# check that an early commit allows a blocked
# transaction to complete
connection default;
connection conn1;
begin;
insert ignore t values(1, 150);
connection conn2;
send update t set b=b where a=1;
connection default;
connection conn1;
commit;
connection conn2;
reap;
# testing conflict "insert" vs. "insert"
connection default;
connection conn1;
begin;
insert ignore t values(1, 100);
......@@ -976,26 +976,26 @@ insert ignore t values(1, 100);
insert ignore t values(2, 100);
insert ignore t values(3, 100);
insert ignore t values(4, 100);
connection default;
connection conn1;
commit;
connection conn2;
insert ignore t values(1, 100);
select * from t;
connection default;
connection conn1;
# check that an early commit allows a blocked
# transaction to complete
connection default;
connection conn1;
begin;
insert ignore t values(1, 150);
connection conn2;
send insert ignore t values(1, 175);
connection default;
connection conn1;
commit;
connection conn2;
reap;
# testing conflict "insert" vs. "replace"
connection default;
connection conn1;
begin;
insert ignore t values(1, 100);
......@@ -1005,26 +1005,26 @@ replace t values(1, 100);
replace t values(2, 100);
replace t values(3, 100);
replace t values(4, 100);
connection default;
connection conn1;
commit;
connection conn2;
replace t values(1, 100);
select * from t;
connection default;
connection conn1;
# check that an early commit allows a blocked
# transaction to complete
connection default;
connection conn1;
begin;
insert ignore t values(1, 150);
connection conn2;
send replace t values(1, 175);
connection default;
connection conn1;
commit;
connection conn2;
reap;
# testing range query "select for update" vs "insert"
connection default;
connection conn1;
begin;
insert ignore t values(1, 100);
......@@ -1034,27 +1034,27 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
select * from t where a<=2 for update;
select * from t where a>=0 for update;
select * from t;
connection default;
connection conn1;
# check that an early commit allows a blocked
# transaction to complete
connection default;
connection conn1;
begin;
insert ignore t values(1, 150);
connection conn2;
send select * from t where a<=2 for update;
connection default;
connection conn1;
commit;
connection conn2;
reap;
# testing range query "update" vs "insert"
connection default;
connection conn1;
begin;
insert ignore t values(1, 100);
......@@ -1064,27 +1064,27 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
update t set b=b where a<=2;
update t set b=b where a>=0;
select * from t;
connection default;
connection conn1;
# check that an early commit allows a blocked
# transaction to complete
connection default;
connection conn1;
begin;
insert ignore t values(1, 150);
connection conn2;
send update t set b=b where a<=2;
connection default;
connection conn1;
commit;
connection conn2;
reap;
# testing conflict "replace" vs. "select for update"
connection default;
connection conn1;
begin;
replace t values(1, 100);
......@@ -1094,26 +1094,26 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
select * from t where a=1 for update;
select * from t;
connection default;
connection conn1;
# check that an early commit allows a blocked
# transaction to complete
connection default;
connection conn1;
begin;
replace t values(1, 150);
connection conn2;
send select * from t where a=1 for update;
connection default;
connection conn1;
commit;
connection conn2;
reap;
# testing conflict "replace" vs. "update"
connection default;
connection conn1;
begin;
replace t values(1, 100);
......@@ -1123,26 +1123,26 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
update t set b=b where a=1;
select * from t;
connection default;
connection conn1;
# check that an early commit allows a blocked
# transaction to complete
connection default;
connection conn1;
begin;
replace t values(1, 150);
connection conn2;
send update t set b=b where a=1;
connection default;
connection conn1;
commit;
connection conn2;
reap;
# testing conflict "replace" vs. "insert"
connection default;
connection conn1;
begin;
replace t values(1, 100);
......@@ -1152,26 +1152,26 @@ insert ignore t values(1, 100);
insert ignore t values(2, 100);
insert ignore t values(3, 100);
insert ignore t values(4, 100);
connection default;
connection conn1;
commit;
connection conn2;
insert ignore t values(1, 100);
select * from t;
connection default;
connection conn1;
# check that an early commit allows a blocked
# transaction to complete
connection default;
connection conn1;
begin;
replace t values(1, 150);
connection conn2;
send insert ignore t values(1, 175);
connection default;
connection conn1;
commit;
connection conn2;
reap;
# testing conflict "replace" vs. "replace"
connection default;
connection conn1;
begin;
replace t values(1, 100);
......@@ -1181,26 +1181,26 @@ replace t values(1, 100);
replace t values(2, 100);
replace t values(3, 100);
replace t values(4, 100);
connection default;
connection conn1;
commit;
connection conn2;
replace t values(1, 100);
select * from t;
connection default;
connection conn1;
# check that an early commit allows a blocked
# transaction to complete
connection default;
connection conn1;
begin;
replace t values(1, 150);
connection conn2;
send replace t values(1, 175);
connection default;
connection conn1;
commit;
connection conn2;
reap;
# testing range query "select for update" vs "replace"
connection default;
connection conn1;
begin;
replace t values(1, 100);
......@@ -1210,27 +1210,27 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
select * from t where a<=2 for update;
select * from t where a>=0 for update;
select * from t;
connection default;
connection conn1;
# check that an early commit allows a blocked
# transaction to complete
connection default;
connection conn1;
begin;
replace t values(1, 150);
connection conn2;
send select * from t where a<=2 for update;
connection default;
connection conn1;
commit;
connection conn2;
reap;
# testing range query "update" vs "replace"
connection default;
connection conn1;
begin;
replace t values(1, 100);
......@@ -1240,27 +1240,27 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
update t set b=b where a<=2;
update t set b=b where a>=0;
select * from t;
connection default;
connection conn1;
# check that an early commit allows a blocked
# transaction to complete
connection default;
connection conn1;
begin;
replace t values(1, 150);
connection conn2;
send update t set b=b where a<=2;
connection default;
connection conn1;
commit;
connection conn2;
reap;
# testing range query "select for update" vs range query "select for update"
connection default;
connection conn1;
begin;
select * from t where a>=2 and a<=4 for update;
......@@ -1272,28 +1272,28 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
select * from t where a>=0 and a<=3 for update;
select * from t where a>=3 and a<=6 for update;
select * from t where a<=2 for update;
select * from t;
connection default;
connection conn1;
# check that an early commit allows a blocked
# transaction to complete
connection default;
connection conn1;
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;
connection conn1;
commit;
connection conn2;
reap;
# testing range query "select for update" vs range query "update"
connection default;
connection conn1;
begin;
select * from t where a>=2 and a<=4 for update;
......@@ -1305,28 +1305,28 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
update t set b=b where a>=0 and a<=3;
update t set b=b where a>=3 and a<=6;
update t set b=b where a<=2;
select * from t;
connection default;
connection conn1;
# check that an early commit allows a blocked
# transaction to complete
connection default;
connection conn1;
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;
connection conn1;
commit;
connection conn2;
reap;
# testing range query "update" vs range query "select for update"
connection default;
connection conn1;
begin;
update t set b=b where a>=2 and a<=4;
......@@ -1338,28 +1338,28 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
select * from t where a>=0 and a<=3 for update;
select * from t where a>=3 and a<=6 for update;
select * from t where a<=2 for update;
select * from t;
connection default;
connection conn1;
# check that an early commit allows a blocked
# transaction to complete
connection default;
connection conn1;
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;
connection conn1;
commit;
connection conn2;
reap;
# testing range query "update" vs range query "update"
connection default;
connection conn1;
begin;
update t set b=b where a>=2 and a<=4;
......@@ -1371,23 +1371,23 @@ 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;
connection default;
connection conn1;
commit;
connection conn2;
update t set b=b where a>=0 and a<=3;
update t set b=b where a>=3 and a<=6;
update t set b=b where a<=2;
select * from t;
connection default;
connection conn1;
# check that an early commit allows a blocked
# transaction to complete
connection default;
connection conn1;
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;
connection conn1;
commit;
connection conn2;
reap;
......
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