# Initial values
|
SELECT @@global.lock_wait_timeout, @@lock_wait_timeout;
|
@@global.lock_wait_timeout @@lock_wait_timeout
|
31536000 31536000
|
#
|
set statement lock_wait_timeout=11 for show global variables like 'lock_wait_timeout';
|
Variable_name Value
|
lock_wait_timeout 31536000
|
SET STATEMENT lock_wait_timeout=12 FOR SELECT SLEEP(2.5);
|
connect con1,localhost,root;
|
#
|
# It's a new connection, so it picked up the current value
|
# of the global variable for the session variable
|
SELECT @@global.lock_wait_timeout, @@lock_wait_timeout;
|
@@global.lock_wait_timeout @@lock_wait_timeout
|
12 12
|
#
|
# Now SET STATEMENT in the other connection ended, so the global value
|
# is back to normal (but the session one is not)
|
SELECT @@global.lock_wait_timeout, @@lock_wait_timeout;
|
@@global.lock_wait_timeout @@lock_wait_timeout
|
31536000 12
|