mariadb/mysql-test/suite/tokudb.locks/t/select-update-1.test
Rich Prohaska 910dafd691 #3497 fix locking tests refs[t:3497]
git-svn-id: file:///svn/mysql/tests/mysql-test@31590 c7de825b-a66e-492c-adef-691d508d4ae1
2011-06-14 13:12:44 +00:00

36 lines
866 B
Text

# test that select for update is executed with serializable isolation
set storage_engine='tokudb';
--disable_warnings
drop table if exists t;
--enable_warnings
create table t (a int primary key, b int);
insert into t values (1,0);
set tokudb_use_write_locks=1;
set session transaction isolation level repeatable read;
begin;
# t1 select for update
select * from t where a=1 for update;
# t2 update
update t set b=b+1 where a=1;
connect(conn1,localhost,root);
set tokudb_use_write_locks=1;
set session transaction isolation level repeatable read;
begin;
# t2 select for update, should hang until t1 commits
send select * from t where a=1 for update;
connection default;
# t1 commit
commit;
connection conn1;
# t2 select for update returns
reap;
# t2 update
update t set b=b+1 where a=1;
select * from t;
commit;
connection default;
disconnect conn1;
drop table t;