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