mirror of
https://github.com/MariaDB/server.git
synced 2025-01-20 05:52:27 +01:00
59 lines
1.2 KiB
Text
59 lines
1.2 KiB
Text
set global innodb_lock_wait_timeout=42;
|
|
connect a,localhost,root,,;
|
|
connect b,localhost,root,,;
|
|
connection a;
|
|
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
|
|
connection b;
|
|
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
|
|
connect c,localhost,root,,;
|
|
connection c;
|
|
select @@innodb_lock_wait_timeout;
|
|
@@innodb_lock_wait_timeout
|
|
347
|
|
disconnect c;
|
|
connection a;
|
|
SET @connection_b_id = <connection_b_id>;
|
|
create table t1(a int primary key)engine=innodb;
|
|
begin;
|
|
insert into t1 values(1),(2),(3);
|
|
connection b;
|
|
select * from t1 for update;
|
|
connection a;
|
|
commit;
|
|
connection b;
|
|
a
|
|
1
|
|
2
|
|
3
|
|
connection a;
|
|
begin;
|
|
insert into t1 values(4);
|
|
connection b;
|
|
set innodb_lock_wait_timeout=3;
|
|
select * from t1 for update;
|
|
connection a;
|
|
commit;
|
|
connection b;
|
|
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
|
disconnect b;
|
|
connection a;
|
|
disconnect a;
|
|
connection default;
|
|
drop table t1;
|
|
set global innodb_lock_wait_timeout=<initial_timeout>;
|