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

[t:3532] regression test and results for 3532


git-svn-id: file:///svn/mysql/tests/mysql-test@36504 c7de825b-a66e-492c-adef-691d508d4ae1
parent 245d1e6b
drop table if exists t;
set global tokudb_lock_timeout = 100;
set global transaction isolation level serializable;
create table t (a int primary key) engine = tokudb;
insert t values (1),(2),(3);
begin;
select * from t for update;
a
1
2
3
select * from t;
a
1
2
3
select * from t where a=1;
a
1
select * from t where a=2;
a
2
select * from t where a=3;
a
3
replace into t values (1);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert ignore t values (3);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
commit;
drop table t;
set global transaction isolation level repeatable read;
set global tokudb_lock_timeout = 4000;
# Tokutek
# test that read locks are not taken with serializable isolation and
# autocommit on, refs 3532
--disable_warnings
drop table if exists t;
--enable_warnings
# low lock wait timeout, to speed up the test a bit
set global tokudb_lock_timeout = 100;
set global transaction isolation level serializable;
# main client creates a table and inserts a few rows
create table t (a int primary key) engine = tokudb;
insert t values (1),(2),(3);
# now grab write locks on the entire table
begin;
select * from t for update;
# second client should be able to read the table
connect(conn1, localhost, root);
select * from t;
select * from t where a=1;
select * from t where a=2;
select * from t where a=3;
# but not write to it
--error ER_LOCK_WAIT_TIMEOUT
replace into t values (1);
--error ER_LOCK_WAIT_TIMEOUT
insert ignore t values (3);
# back to the main client, commit the transaction
connection default;
commit;
# cleanup
drop table t;
set global transaction isolation level repeatable read;
set global tokudb_lock_timeout = 4000;
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