1
source include/master-slave.inc;
4
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
7
create table t1(n int);
9
insert into t1 values(get_lock("lock",2));
13
select get_lock("lock",2);
15
select release_lock("lock");
21
do get_lock("lock",2);
22
do release_lock("lock");
29
select get_lock("lock",3);
31
# There is no point in testing REPLICATIION of the IS_*_LOCK
32
# functions; slave does not run with the same concurrency context as
33
# master (generally in slave we can't know that on master this lock
34
# was already held by another connection and so that the the
35
# get_lock() we're replicating timed out on master hence returned 0,
36
# or that the is_free_lock() we're playing returned 0 etc.
37
# But here all we do is test these functions outside of replication.
38
select is_free_lock("lock"), is_used_lock("lock") = connection_id();
39
explain extended select is_free_lock("lock"), is_used_lock("lock");
40
# Check lock functions
41
select is_free_lock("lock2");
42
select is_free_lock(NULL);