blob: fcd89d5783f88e663616646bd278e5e51a56a786 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
source include/have_tokudb.inc;
source include/count_sessions.inc;
# test that select for update is executed with serializable isolation
create table t (a int primary key, b int) engine=tokudb;
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 tokudb_lock_timeout=60000;
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;
source include/wait_until_count_sessions.inc;
|