mirror of
				https://github.com/MariaDB/server.git
				synced 2025-11-03 14:33:32 +03:00 
			
		
		
		
	- Second scenario checked:
  Ensure via wait routines that the commit comes after the
  processing of the statement which should get finally
  the ER_LOCK_WAIT_TIMEOUT
  --> This should prevent the current bug.
- First scenario checked:
  Ensure via wait routines that the statement is already waiting
  for getting the lock before the commit is given.
  --> No effect on the current bug, but ensure that the right
      scenario is reached.
- Take care that disconnects are finished before the test ends.
  --> Reduce the potential to harm succeeding tests.
- "Mangle" the printout of the current default innodb_lock_wait_timeout value
  --> No need to adjust the test in case the default gets changed in future.
		
	
		
			
				
	
	
		
			41 lines
		
	
	
		
			953 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			41 lines
		
	
	
		
			953 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
set global innodb_lock_wait_timeout=42;
 | 
						|
select @@innodb_lock_wait_timeout;
 | 
						|
@@innodb_lock_wait_timeout
 | 
						|
42
 | 
						|
set innodb_lock_wait_timeout=1;
 | 
						|
select @@innodb_lock_wait_timeout;
 | 
						|
@@innodb_lock_wait_timeout
 | 
						|
1
 | 
						|
select @@innodb_lock_wait_timeout;
 | 
						|
@@innodb_lock_wait_timeout
 | 
						|
42
 | 
						|
set global innodb_lock_wait_timeout=347;
 | 
						|
select @@innodb_lock_wait_timeout;
 | 
						|
@@innodb_lock_wait_timeout
 | 
						|
42
 | 
						|
set innodb_lock_wait_timeout=10;
 | 
						|
select @@innodb_lock_wait_timeout;
 | 
						|
@@innodb_lock_wait_timeout
 | 
						|
10
 | 
						|
select @@innodb_lock_wait_timeout;
 | 
						|
@@innodb_lock_wait_timeout
 | 
						|
347
 | 
						|
SET @connection_b_id = <connection_b_id>;
 | 
						|
create table t1(a int primary key)engine=innodb;
 | 
						|
begin;
 | 
						|
insert into t1 values(1),(2),(3);
 | 
						|
select * from t1 for update;
 | 
						|
commit;
 | 
						|
a
 | 
						|
1
 | 
						|
2
 | 
						|
3
 | 
						|
begin;
 | 
						|
insert into t1 values(4);
 | 
						|
set innodb_lock_wait_timeout=3;
 | 
						|
select * from t1 for update;
 | 
						|
commit;
 | 
						|
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
 | 
						|
drop table t1;
 | 
						|
set global innodb_lock_wait_timeout=<initial_timeout>;
 |