2011-06-26 19:07:07 +00:00
|
|
|
# test that update only take write locks
|
2011-06-13 18:58:05 +00:00
|
|
|
# t1 scans all of the rows in a table and updates 1 of them
|
|
|
|
# t1 grabs a write range lock on -infinity +infinity
|
|
|
|
# t2 scans all of the rows in a table except the one updated by t1
|
|
|
|
# t2 should hang until t1 commits
|
|
|
|
|
|
|
|
set storage_engine='tokudb';
|
|
|
|
|
|
|
|
--disable_warnings
|
|
|
|
drop table if exists t;
|
|
|
|
--enable_warnings
|
|
|
|
|
2011-06-14 13:12:44 +00:00
|
|
|
connect(conn1,localhost,root);
|
2011-06-13 18:58:05 +00:00
|
|
|
|
|
|
|
connection default;
|
|
|
|
create table t (a int primary key, b int);
|
|
|
|
insert into t values (1,0),(2,1),(3,0);
|
|
|
|
begin;
|
|
|
|
update t set b=b+1 where b>0;
|
|
|
|
|
|
|
|
connection conn1;
|
|
|
|
set transaction isolation level serializable;
|
|
|
|
send select * from t where a!=2;
|
|
|
|
|
|
|
|
connection default;
|
|
|
|
commit;
|
|
|
|
|
|
|
|
connection conn1;
|
|
|
|
reap;
|
|
|
|
|
|
|
|
connection default;
|
|
|
|
disconnect conn1;
|
|
|
|
|
|
|
|
drop table t;
|