mirror of
https://github.com/MariaDB/server.git
synced 2025-01-21 06:22:28 +01:00
[t:3981] test for border locking
git-svn-id: file:///svn/mysql/tests/mysql-test@37441 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
81de365123
commit
3b5238a4bd
1 changed files with 132 additions and 0 deletions
132
mysql-test/suite/tokudb.locks/t/border-locks.test
Normal file
132
mysql-test/suite/tokudb.locks/t/border-locks.test
Normal file
|
@ -0,0 +1,132 @@
|
|||
# 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;
|
Loading…
Reference in a new issue