blob: 56d5f4a3a6c0e05141a8e135f11f93c4e69a4870 (
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
# verify that information_schema.tokudb_locks gets populated with locks for 2 clients
source include/have_tokudb.inc;
set default_storage_engine='tokudb';
set tokudb_prelock_empty=false;
disable_warnings;
drop table if exists t;
enable_warnings;
create table t (id int primary key);
set autocommit=0;
let $default_id=`select connection_id()`;
# should be empty
select * from information_schema.tokudb_locks;
connect (conn_a,localhost,root,,);
set autocommit=0;
set tokudb_prelock_empty=OFF; # disable bulk loader
insert into t values (1);
connect (conn_b,localhost,root,,);
set autocommit=0;
send insert into t values (1);
# should find the presence of a lock on 2nd transaction
connection default;
let $wait_condition= select count(*)=1 from information_schema.processlist where info='insert into t values (1)' and state='update';
source include/wait_condition.inc;
real_sleep 1; # delay a little to shorten the update -> write row -> lock wait race
replace_column 1 TRX_ID 2 MYSQL_ID;
replace_result $datadir ./;
eval select * from information_schema.tokudb_locks;
connection conn_a;
commit;
# verify that the lock on the 1st transaction is released and replaced by the lock for the 2nd transaction
replace_column 1 TRX_ID 2 MYSQL_ID;
replace_result $datadir ./;
select * from information_schema.tokudb_locks;
connection conn_b;
--error 1062
reap;
commit;
disconnect conn_b;
connection default;
# verify that the lockwait on the 2nd transaction has been released
# should be be empty
select * from information_schema.tokudb_locks;
drop table t;
|