2001-08-31 15:55:58 -06:00
|
|
|
source include/master-slave.inc;
|
2002-08-08 03:12:02 +03:00
|
|
|
|
2001-08-31 15:55:58 -06:00
|
|
|
create table t1(n int);
|
|
|
|
insert into t1 values(get_lock("lock",2));
|
|
|
|
dirty_close master;
|
|
|
|
connection master1;
|
2001-12-13 17:21:04 -07:00
|
|
|
select get_lock("lock",2);
|
2003-10-30 12:57:26 +02:00
|
|
|
|
2001-12-12 18:55:33 -07:00
|
|
|
select release_lock("lock");
|
2001-12-21 07:00:58 +02:00
|
|
|
#ignore
|
|
|
|
disable_query_log;
|
2001-12-18 21:56:36 -07:00
|
|
|
let $1=2000;
|
2001-12-18 19:53:56 -07:00
|
|
|
while ($1)
|
|
|
|
{
|
2001-12-18 21:56:36 -07:00
|
|
|
do get_lock("lock",2);
|
|
|
|
do release_lock("lock");
|
2001-12-18 19:53:56 -07:00
|
|
|
dec $1;
|
|
|
|
}
|
2001-12-21 07:00:58 +02:00
|
|
|
enable_query_log;
|
2001-08-31 15:55:58 -06:00
|
|
|
save_master_pos;
|
|
|
|
connection slave;
|
|
|
|
sync_with_master;
|
|
|
|
select get_lock("lock",3);
|
|
|
|
select * from t1;
|
2004-06-21 10:21:20 +03:00
|
|
|
select is_free_lock("lock"), is_used_lock("lock") = connection_id();
|
2003-10-30 12:57:26 +02:00
|
|
|
explain extended select is_free_lock("lock"), is_used_lock("lock");
|
2002-06-30 18:57:21 +03:00
|
|
|
# Check lock functions
|
|
|
|
select is_free_lock("lock2");
|
|
|
|
select is_free_lock(NULL);
|
2001-08-31 15:55:58 -06:00
|
|
|
connection master1;
|
|
|
|
drop table t1;
|
|
|
|
save_master_pos;
|
|
|
|
connection slave;
|
|
|
|
sync_with_master;
|
2005-07-28 03:22:47 +03:00
|
|
|
|
|
|
|
# End of 4.1 tests
|