2002-10-25 01:46:14 +02:00
|
|
|
stop slave;
|
2002-08-08 02:12:02 +02:00
|
|
|
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
2001-09-28 07:05:54 +02:00
|
|
|
reset master;
|
|
|
|
reset slave;
|
|
|
|
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
2002-10-25 01:46:14 +02:00
|
|
|
start slave;
|
2001-09-28 07:05:54 +02:00
|
|
|
create table t1(n int);
|
|
|
|
insert into t1 values(get_lock("lock",2));
|
2001-12-15 05:00:01 +01:00
|
|
|
select get_lock("lock",2);
|
|
|
|
get_lock("lock",2)
|
|
|
|
1
|
|
|
|
select release_lock("lock");
|
|
|
|
release_lock("lock")
|
|
|
|
1
|
2001-09-28 07:05:54 +02:00
|
|
|
select get_lock("lock",3);
|
2001-08-31 23:55:58 +02:00
|
|
|
get_lock("lock",3)
|
|
|
|
1
|
2001-09-28 07:05:54 +02:00
|
|
|
select * from t1;
|
2001-08-31 23:55:58 +02:00
|
|
|
n
|
|
|
|
1
|
2004-06-21 09:21:20 +02:00
|
|
|
select is_free_lock("lock"), is_used_lock("lock") = connection_id();
|
|
|
|
is_free_lock("lock") is_used_lock("lock") = connection_id()
|
|
|
|
0 1
|
2003-10-30 11:57:26 +01:00
|
|
|
explain extended select is_free_lock("lock"), is_used_lock("lock");
|
|
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
|
|
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
|
|
|
Warnings:
|
2006-06-27 19:28:32 +02:00
|
|
|
Note 1003 select is_free_lock(_latin1'lock') AS `is_free_lock("lock")`,is_used_lock(_latin1'lock') AS `is_used_lock("lock")`
|
2002-06-30 17:57:21 +02:00
|
|
|
select is_free_lock("lock2");
|
|
|
|
is_free_lock("lock2")
|
2002-06-29 15:25:09 +02:00
|
|
|
1
|
2002-06-30 17:57:21 +02:00
|
|
|
select is_free_lock(NULL);
|
|
|
|
is_free_lock(NULL)
|
|
|
|
NULL
|
2001-09-28 07:05:54 +02:00
|
|
|
drop table t1;
|