~ubuntu-branches/ubuntu/trusty/mariadb-5.5/trusty-proposed

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Otto Kekäläinen
  • Date: 2013-12-22 10:27:05 UTC
  • Revision ID: package-import@ubuntu.com-20131222102705-mndw7s12mz0szrcn
Tags: upstream-5.5.32
Import upstream version 5.5.32

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
source include/master-slave.inc;
 
2
 
 
3
--disable_query_log
 
4
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
 
5
--enable_query_log
 
6
 
 
7
create table t1(n int);
 
8
--disable_warnings
 
9
insert into t1 values(get_lock("lock",2));
 
10
--enable_warnings
 
11
dirty_close master;
 
12
connection master1;
 
13
select get_lock("lock",2);
 
14
 
 
15
select release_lock("lock");
 
16
#ignore 
 
17
disable_query_log;
 
18
let $1=2000;
 
19
while ($1)
 
20
{
 
21
  do get_lock("lock",2);
 
22
  do release_lock("lock");
 
23
  dec $1;
 
24
}
 
25
enable_query_log;
 
26
save_master_pos;
 
27
connection slave;
 
28
sync_with_master;
 
29
select get_lock("lock",3);
 
30
select * from t1;
 
31
# There is no point in testing REPLICATIION of the IS_*_LOCK
 
32
# functions; slave does not run with the same concurrency context as
 
33
# master (generally in slave we can't know that on master this lock
 
34
# was already held by another connection and so that the the
 
35
# get_lock() we're replicating timed out on master hence returned 0,
 
36
# or that the is_free_lock() we're playing returned 0 etc.
 
37
# But here all we do is test these functions outside of replication.
 
38
select is_free_lock("lock"), is_used_lock("lock") = connection_id();
 
39
explain extended select is_free_lock("lock"), is_used_lock("lock");
 
40
# Check lock functions
 
41
select is_free_lock("lock2");
 
42
select is_free_lock(NULL);
 
43
connection master1;
 
44
drop table t1;
 
45
save_master_pos;
 
46
connection slave;
 
47
sync_with_master;
 
48
 
 
49
# End of 4.1 tests