mirror of
https://github.com/MariaDB/server.git
synced 2025-01-23 15:24:16 +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).
64 lines
1.1 KiB
Text
64 lines
1.1 KiB
Text
-- source include/have_innodb.inc
|
|
|
|
let $timeout=`select @@innodb_lock_wait_timeout`;
|
|
set global innodb_lock_wait_timeout=42;
|
|
|
|
connect (a,localhost,root,,);
|
|
connect (b,localhost,root,,);
|
|
|
|
connection a;
|
|
select @@innodb_lock_wait_timeout;
|
|
set innodb_lock_wait_timeout=1;
|
|
select @@innodb_lock_wait_timeout;
|
|
|
|
connection b;
|
|
select @@innodb_lock_wait_timeout;
|
|
set global innodb_lock_wait_timeout=347;
|
|
select @@innodb_lock_wait_timeout;
|
|
set innodb_lock_wait_timeout=1;
|
|
select @@innodb_lock_wait_timeout;
|
|
|
|
connect (c,localhost,root,,);
|
|
connection c;
|
|
select @@innodb_lock_wait_timeout;
|
|
connection default;
|
|
disconnect c;
|
|
|
|
connection a;
|
|
create table t1(a int primary key)engine=innodb;
|
|
begin;
|
|
insert into t1 values(1),(2),(3);
|
|
|
|
connection b;
|
|
--send
|
|
select * from t1 for update;
|
|
|
|
connection a;
|
|
commit;
|
|
|
|
connection b;
|
|
reap;
|
|
|
|
connection a;
|
|
begin;
|
|
insert into t1 values(4);
|
|
|
|
connection b;
|
|
--send
|
|
select * from t1 for update;
|
|
|
|
connection a;
|
|
sleep 2;
|
|
commit;
|
|
|
|
connection b;
|
|
--error ER_LOCK_WAIT_TIMEOUT
|
|
reap;
|
|
drop table t1;
|
|
|
|
connection default;
|
|
|
|
disconnect a;
|
|
disconnect b;
|
|
|
|
eval set global innodb_lock_wait_timeout=$timeout;
|