mirror of
				https://github.com/MariaDB/server.git
				synced 2025-10-31 19:06:14 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			62 lines
		
	
	
	
		
			1.9 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			62 lines
		
	
	
	
		
			1.9 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
| source include/master-slave.inc;
 | |
| 
 | |
| --disable_query_log
 | |
| CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
 | |
| call mtr.add_suppression("Could not read packet:.* errno: 11 ");
 | |
| # The following one comes from calling dirty_close on client side
 | |
| call mtr.add_suppression("Could not read packet:.* errno: 2 ");
 | |
| call mtr.add_suppression("Could not read packet:.* errno: 35 ");
 | |
| --enable_query_log
 | |
| 
 | |
| let $org_log_warnings=`select @@global.log_warnings`;
 | |
| 
 | |
| # Test extended warnings
 | |
| SET GLOBAL LOG_WARNINGS=4;
 | |
| 
 | |
| create table t1(n int);
 | |
| # Use of get_lock gives a warning for unsafeness if binlog_format=statement
 | |
| --disable_warnings
 | |
| insert into t1 values(get_lock("lock",2));
 | |
| --enable_warnings
 | |
| dirty_close master;
 | |
| connection master1;
 | |
| select get_lock("lock",2);
 | |
| 
 | |
| select release_lock("lock");
 | |
| #ignore 
 | |
| disable_query_log;
 | |
| let $1=2000;
 | |
| while ($1)
 | |
| {
 | |
|   do get_lock("lock",2);
 | |
|   do release_lock("lock");
 | |
|   dec $1;
 | |
| }
 | |
| enable_query_log;
 | |
| sync_slave_with_master;
 | |
| select get_lock("lock",3);
 | |
| select * from t1;
 | |
| # There is no point in testing REPLICATION of the IS_*_LOCK
 | |
| # functions; slave does not run with the same concurrency context as
 | |
| # master (generally in slave we can't know that on master this lock
 | |
| # was already held by another connection and so that the the
 | |
| # get_lock() we're replicating timed out on master hence returned 0,
 | |
| # or that the is_free_lock() we're playing returned 0 etc.
 | |
| # But here all we do is test these functions outside of replication.
 | |
| select is_free_lock("lock"), is_used_lock("lock") = connection_id();
 | |
| explain extended select is_free_lock("lock"), is_used_lock("lock");
 | |
| # Check lock functions
 | |
| select is_free_lock("lock2");
 | |
| select is_free_lock(NULL);
 | |
| connection master1;
 | |
| drop table t1;
 | |
| sync_slave_with_master;
 | |
| 
 | |
| connection default;
 | |
| --disable_query_log
 | |
| --eval SET GLOBAL LOG_WARNINGS=$org_log_warnings;
 | |
| --enable_query_log
 | |
| 
 | |
| --source include/rpl_end.inc
 | |
| 
 | |
| # End of 4.1 tests
 | 
