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): ...@@ -26,18 +26,16 @@ def mysqlgen_select_where(k, where):
# mysql test code generation # mysql test code generation
def mysqlgen_prepare(): def mysqlgen_prepare():
print "# prepare with some common parameters" print "# prepare with some common parameters"
print "set storage_engine=tokudb;" print "connect(conn1, localhost, root);"
#print "connect(conn1, localhost, root);"
#print "set autocommit=off;"
print "connect(conn2, localhost, root);" print "connect(conn2, localhost, root);"
print "connection default;" print "connection conn1;"
print "" print ""
def mysqlgen_reload_table(): def mysqlgen_reload_table():
print "# drop old table, generate new one. 4 rows" print "# drop old table, generate new one. 4 rows"
print "--disable_warnings" print "--disable_warnings"
print "drop table if exists t;" print "drop table if exists t;"
print "--enable_warnings" 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): for i in range(1, 7):
mysqlgen_insert_ignore("a", i, "b", i*i) mysqlgen_insert_ignore("a", i, "b", i*i)
print "" print ""
...@@ -72,7 +70,7 @@ for timeout in timeouts: ...@@ -72,7 +70,7 @@ for timeout in timeouts:
# point vs point contention # point vs point contention
for tb, qb in write_point_queries: for tb, qb in write_point_queries:
print "# testing conflict \"%s\" vs. \"%s\"" % (ta, tb) print "# testing conflict \"%s\" vs. \"%s\"" % (ta, tb)
print "connection default;" print "connection conn1;"
print "begin;" print "begin;"
print "" print ""
qa("a", "1", "b", "100") qa("a", "1", "b", "100")
...@@ -83,33 +81,33 @@ for timeout in timeouts: ...@@ -83,33 +81,33 @@ for timeout in timeouts:
qb("a", k, "b", "100") qb("a", k, "b", "100")
# 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 default;" print "connection conn1;"
print "commit;" print "commit;"
print "connection conn2;" print "connection conn2;"
qb("a", "1", "b", "100") qb("a", "1", "b", "100")
mysqlgen_select_star() mysqlgen_select_star()
print "connection default;" print "connection conn1;"
print "" print ""
# test early commit # test early commit
if timeout > 0: if timeout > 0:
print "# check that an early commit allows a blocked" print "# check that an early commit allows a blocked"
print "# transaction to complete" print "# transaction to complete"
print "connection default;" print "connection conn1;"
print "begin;" print "begin;"
qa("a", "1", "b", "150") qa("a", "1", "b", "150")
print "connection conn2;" print "connection conn2;"
# this makes the query asynchronous, so we can jump back # 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 ", print "send ",
qb("a", "1", "b", "175") qb("a", "1", "b", "175")
print "connection default;" print "connection conn1;"
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 default;" print "connection conn1;"
print "begin;" print "begin;"
print "" print ""
qa("a", "1", "b", "100") qa("a", "1", "b", "100")
...@@ -121,34 +119,34 @@ for timeout in timeouts: ...@@ -121,34 +119,34 @@ for timeout in timeouts:
rq("a", "b", ">2") rq("a", "b", ">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 default;" print "connection conn1;"
print "commit;" print "commit;"
print "connection conn2;" print "connection conn2;"
rq("a", "b", "<=2") rq("a", "b", "<=2")
rq("a", "b", ">=0") rq("a", "b", ">=0")
mysqlgen_select_star() mysqlgen_select_star()
print "connection default;" print "connection conn1;"
print "" print ""
# test early commit # test early commit
if timeout > 0: if timeout > 0:
print "# check that an early commit allows a blocked" print "# check that an early commit allows a blocked"
print "# transaction to complete" print "# transaction to complete"
print "connection default;" print "connection conn1;"
print "begin;" print "begin;"
qa("a", "1", "b", "150") qa("a", "1", "b", "150")
print "connection conn2;" print "connection conn2;"
# this makes the query asynchronous, so we can jump back # 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 ", print "send ",
rq("a", "b", "<=2") rq("a", "b", "<=2")
print "connection default;" print "connection conn1;"
print "commit;" print "commit;"
print "connection conn2;" print "connection conn2;"
print "reap;" print "reap;"
for rt, rq in write_range_queries: for rt, rq in write_range_queries:
for rtb, rqb in write_range_queries: for rtb, rqb in write_range_queries:
print "# testing range query \"%s\" vs range query \"%s\"" % (rt, rtb) print "# testing range query \"%s\" vs range query \"%s\"" % (rt, rtb)
print "connection default;" print "connection conn1;"
print "begin;" print "begin;"
print "" print ""
rq("a", "b", ">=2 and a<=4") rq("a", "b", ">=2 and a<=4")
...@@ -162,28 +160,28 @@ for timeout in timeouts: ...@@ -162,28 +160,28 @@ for timeout in timeouts:
rqb("a", "b", ">=5") rqb("a", "b", ">=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 default;" print "connection conn1;"
print "commit;" print "commit;"
print "connection conn2;" print "connection conn2;"
rqb("a", "b", ">=0 and a<=3") rqb("a", "b", ">=0 and a<=3")
rqb("a", "b", ">=3 and a<=6") rqb("a", "b", ">=3 and a<=6")
rqb("a", "b", "<=2") rqb("a", "b", "<=2")
mysqlgen_select_star() mysqlgen_select_star()
print "connection default;" print "connection conn1;"
print "" print ""
# test early commit # test early commit
if timeout > 0: if timeout > 0:
print "# check that an early commit allows a blocked" print "# check that an early commit allows a blocked"
print "# transaction to complete" print "# transaction to complete"
print "connection default;" print "connection conn1;"
print "begin;" print "begin;"
rq("a", "b", ">=2 and a<=4") rq("a", "b", ">=2 and a<=4")
print "connection conn2;" print "connection conn2;"
# this makes the query asynchronous, so we can jump back # 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 ", print "send ",
rqb("a", "b", ">=0 and a<=3") rqb("a", "b", ">=0 and a<=3")
print "connection default;" print "connection conn1;"
print "commit;" print "commit;"
print "connection conn2;" print "connection conn2;"
print "reap;" print "reap;"
......
set storage_engine='tokudb';
select @@tokudb_lock_timeout; select @@tokudb_lock_timeout;
@@tokudb_lock_timeout @@tokudb_lock_timeout
30000000 30000000
......
set storage_engine=tokudb;
drop table if exists t; 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(1, 1);
insert ignore t values(2, 4); insert ignore t values(2, 4);
insert ignore t values(3, 9); insert ignore t values(3, 9);
......
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
# Test that getting and setting the value for # Test that getting and setting the value for
# blocking row lock timeout works correctly. # blocking row lock timeout works correctly.
set storage_engine='tokudb';
# Make sure we can read/write the global lock timeout system variable # Make sure we can read/write the global lock timeout system variable
select @@tokudb_lock_timeout; select @@tokudb_lock_timeout;
set global tokudb_lock_timeout=1234567; 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;
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