~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to mysql-test/suite/engines/funcs/t/rpl_get_lock.test

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-05-11 18:47:32 UTC
  • mto: (2.1.2 sid) (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20100511184732-jhn055kfhxze24kt
Tags: upstream-5.1.46
ImportĀ upstreamĀ versionĀ 5.1.46

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
source include/master-slave.inc;
 
2
 
 
3
create table t1(n int);
 
4
--disable_warnings
 
5
insert into t1 values(get_lock("lock",2));
 
6
--enable_warnings
 
7
dirty_close master;
 
8
connection master1;
 
9
select get_lock("lock",2);
 
10
 
 
11
select release_lock("lock");
 
12
#ignore 
 
13
disable_query_log;
 
14
let $1=2000;
 
15
while ($1)
 
16
{
 
17
  do get_lock("lock",2);
 
18
  do release_lock("lock");
 
19
  dec $1;
 
20
}
 
21
enable_query_log;
 
22
save_master_pos;
 
23
connection slave;
 
24
sync_with_master;
 
25
select get_lock("lock",3);
 
26
select * from t1;
 
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);
 
39
connection master1;
 
40
drop table t1;
 
41
save_master_pos;
 
42
connection slave;
 
43
sync_with_master;
 
44
 
 
45
# End of 4.1 tests