Debian Codegraph @

mysql-test/suite/rpl/t/rpl_get_lock.test

raw
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 call mtr.add_suppression("Could not read packet:.* errno: 11 ");
6 # The following one comes from calling dirty_close on client side
7 call mtr.add_suppression("Could not read packet:.* errno: 2 ");
8 call mtr.add_suppression("Could not read packet:.* errno: 35 ");
9 --enable_query_log
10
11 let $org_log_warnings=`select @@global.log_warnings`;
12
13 # Test extended warnings
14 SET GLOBAL LOG_WARNINGS=4;
15
16 create table t1(n int);
17 # Use of get_lock gives a warning for unsafeness if binlog_format=statement
18 --disable_warnings
19 insert into t1 values(get_lock("lock",2));
20 --enable_warnings
21 dirty_close master;
22 connection master1;
23 select get_lock("lock",2);
24
25 select release_lock("lock");
26 #ignore
27 disable_query_log;
28 let $1=2000;
29 while ($1)
30 {
31 do get_lock("lock",2);
32 do release_lock("lock");
33 dec $1;
34 }
35 enable_query_log;
36 sync_slave_with_master;
37 select get_lock("lock",3);
38 select * from t1;
39 # There is no point in testing REPLICATIION of the IS_*_LOCK
40 # functions; slave does not run with the same concurrency context as
41 # master (generally in slave we can't know that on master this lock
42 # was already held by another connection and so that the the
43 # get_lock() we're replicating timed out on master hence returned 0,
44 # or that the is_free_lock() we're playing returned 0 etc.
45 # But here all we do is test these functions outside of replication.
46 select is_free_lock("lock"), is_used_lock("lock") = connection_id();
47 explain extended select is_free_lock("lock"), is_used_lock("lock");
48 # Check lock functions
49 select is_free_lock("lock2");
50 select is_free_lock(NULL);
51 connection master1;
52 drop table t1;
53 sync_slave_with_master;
54
55 connection default;
56 --disable_query_log
57 --eval SET GLOBAL LOG_WARNINGS=$org_log_warnings;
58 --enable_query_log
59
60 --source include/rpl_end.inc
61
62 # End of 4.1 tests