blob: 5e58753e59a5ce70c247af8c1aca1ce8035663a3 (
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
|
source include/master-slave.inc;
create table t1(n int);
insert into t1 values(get_lock("lock",2));
dirty_close master;
connection master1;
select get_lock("lock",2);
select release_lock("lock");
#ignore
disable_query_log;
let $1=2000;
while ($1)
{
do get_lock("lock",2);
do release_lock("lock");
dec $1;
}
enable_query_log;
save_master_pos;
connection slave;
sync_with_master;
select get_lock("lock",3);
select * from t1;
select is_free_lock("lock"), is_used_lock("lock") = connection_id();
explain extended select is_free_lock("lock"), is_used_lock("lock");
# Check lock functions
select is_free_lock("lock2");
select is_free_lock(NULL);
connection master1;
drop table t1;
save_master_pos;
connection slave;
sync_with_master;
|