mirror of
				https://github.com/MariaDB/server.git
				synced 2025-11-03 14:33:32 +03:00 
			
		
		
		
	
		
			
				
	
	
		
			35 lines
		
	
	
		
			786 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			35 lines
		
	
	
		
			786 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
# Let's see if FLUSH TABLES WITH READ LOCK blocks COMMIT of existing
 | 
						|
# transactions.
 | 
						|
# We verify that we did not introduce a deadlock.
 | 
						|
# This is intended to mimick how mysqldump and innobackup work.
 | 
						|
 | 
						|
-- source include/have_log_bin.inc
 | 
						|
 | 
						|
# And it requires InnoDB
 | 
						|
-- source include/have_log_bin.inc
 | 
						|
-- source include/have_innodb.inc
 | 
						|
 | 
						|
connect (con1,localhost,root,,);
 | 
						|
connect (con2,localhost,root,,);
 | 
						|
 | 
						|
# FLUSH TABLES WITH READ LOCK should block writes to binlog too
 | 
						|
connection con1;
 | 
						|
create table t1 (a int) engine=innodb;
 | 
						|
reset master;
 | 
						|
set autocommit=0;
 | 
						|
insert t1 values (1);
 | 
						|
connection con2;
 | 
						|
flush tables with read lock;
 | 
						|
show master status;
 | 
						|
connection con1;
 | 
						|
send commit;
 | 
						|
connection con2;
 | 
						|
sleep 1;
 | 
						|
show master status;
 | 
						|
unlock tables;
 | 
						|
connection con1;
 | 
						|
reap;
 | 
						|
drop table t1;
 | 
						|
set autocommit=1;
 | 
						|
 |