1 source include/master-slave.inc;
3 create table t1(n int);
5 insert into t1 values(get_lock("lock",2));
9 select get_lock("lock",2);
11 select release_lock("lock");
17 do get_lock("lock",2);
18 do release_lock("lock");
25 select get_lock("lock",3);
27 # There is no point in testing REPLICATIION of the IS_*_LOCK
28 # functions; slave does not run with the same concurrency context as
29 # master (generally in slave we can't know that on master this lock
30 # was already held by another connection and so that the the
31 # get_lock() we're replicating timed out on master hence returned 0,
32 # or that the is_free_lock() we're playing returned 0 etc.
33 # But here all we do is test these functions outside of replication.
34 select is_free_lock("lock"), is_used_lock("lock") = connection_id();
35 explain extended select is_free_lock("lock"), is_used_lock("lock");
36 # Check lock functions
37 select is_free_lock("lock2");
38 select is_free_lock(NULL);