Commit 3b5238a4 authored by John Esmet's avatar John Esmet

[t:3981] test for border locking


git-svn-id: file:///svn/mysql/tests/mysql-test@37441 c7de825b-a66e-492c-adef-691d508d4ae1
parent 81de3651
# Tokutek
# Make sure that lock ranges behave correctly
--disable_warnings
drop table if exists t;
--enable_warnings
connect(conn1, localhost, root);
connection default;
set global tokudb_lock_timeout=200;
# Basic key
create table t (a int primary key, b int) engine=tokudb;
insert into t values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6);
begin;
select * from t where a < 3 for update;
connection conn1;
select * from t where a >= 3 for update;
select * from t where a = 3 for update;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a < 3 for update;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a <= 3 for update;
connection default;
commit;
begin;
select * from t where a > 3 for update;
connection conn1;
select * from t where a <= 3 for update;
select * from t where a = 3 for update;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a > 3 for update;
connection default;
commit;
begin;
select * from t where a = 5 for update;
connection conn1;
select * from t where a > 5 for update;
select * from t where a < 5 for update;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a >= 5 for update;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a <= 5 for update;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a = 5 for update;
connection default;
commit;
begin;
select * from t where a > 2 and a < 5 for update;
connection conn1;
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;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a > 2 for update;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a >= 2 for update;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a < 5 for update;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a <= 5 for update;
connection default;
commit;
drop table t;
# Double key
create table t (a int, b int, primary key (a,b)) engine=tokudb;
insert into t values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6);
begin;
select * from t where a < 3 for update;
connection conn1;
select * from t where a >= 3 for update;
select * from t where a = 3 for update;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a < 3 for update;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a <= 3 for update;
connection default;
commit;
begin;
select * from t where a > 3 for update;
connection conn1;
select * from t where a <= 3 for update;
select * from t where a = 3 for update;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a > 3 for update;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a >= 3 for update;
connection default;
commit;
begin;
select * from t where a = 5 for update;
connection conn1;
select * from t where a > 5 for update;
select * from t where a < 5 for update;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a = 5 for update;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a >= 5 for update;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a <= 5 for update;
connection default;
ommit;
begin;
select * from t where a > 2 and a < 5 for update;
connection conn1;
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;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a <= 5 for update;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a < 5 for update;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a >= 2 for update;
--error ER_LOCK_WAIT_TIMEOUT
select * from t where a > 2 for update;
connection default;
commit;
drop table t;
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