mariadb/mysql-test/suite/tokudb/t/locks-select-update-3.test
Rich Prohaska 034a2219f0 refs #6440 move locking mysql tests
git-svn-id: file:///svn/mysql/tests/mysql-test@55032 c7de825b-a66e-492c-adef-691d508d4ae1
2013-04-03 17:15:35 +00:00

34 lines
812 B
Text

# test that select for update is executed with serializable isolation
SET DEFAULT_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 session transaction isolation level read committed;
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 session transaction isolation level read committed;
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;