mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 14:54:20 +01:00
be56c64772
(Bug #36285, rb://9). innodb-index.test, innodb-index.result: Set innodb_lock_wait_timeout as a session variable instead of relying on the global value. innodb-index-master.opt: Remove. innodb-timeout.test: Test that setting the innodb_lock_wait_timeout works as advertised. thd_lock_wait_timeout(): New function, to retrieve the lock wait timeout for a given MySQL client connection (thd), or the global value (thd==NULL). srv_lock_wait_timeout, innobase_lock_wait_timeout: Remove. Replace MYSQL_SYSVAR_LONG(lock_wait_timeout) with MYSQL_THDVAR_ULONG(lock_wait_timeout).
38 lines
862 B
Text
38 lines
862 B
Text
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=1;
|
|
select @@innodb_lock_wait_timeout;
|
|
@@innodb_lock_wait_timeout
|
|
1
|
|
select @@innodb_lock_wait_timeout;
|
|
@@innodb_lock_wait_timeout
|
|
347
|
|
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);
|
|
select * from t1 for update;
|
|
commit;
|
|
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
|
drop table t1;
|
|
set global innodb_lock_wait_timeout=50;
|