641.2.1
by Monty Taylor
InnoDB Plugin 1.0.2 |
1 |
-- source include/have_innodb.inc |
2 |
||
3 |
let $timeout=`select @@innodb_lock_wait_timeout`; |
|
4 |
set global innodb_lock_wait_timeout=42; |
|
5 |
||
6 |
connect (a,localhost,root,,); |
|
7 |
connect (b,localhost,root,,); |
|
8 |
||
9 |
connection a; |
|
10 |
select @@innodb_lock_wait_timeout; |
|
11 |
set innodb_lock_wait_timeout=1; |
|
12 |
select @@innodb_lock_wait_timeout; |
|
13 |
||
14 |
connection b; |
|
15 |
select @@innodb_lock_wait_timeout; |
|
16 |
set global innodb_lock_wait_timeout=347; |
|
17 |
select @@innodb_lock_wait_timeout; |
|
18 |
set innodb_lock_wait_timeout=1; |
|
19 |
select @@innodb_lock_wait_timeout; |
|
20 |
||
21 |
connect (c,localhost,root,,); |
|
22 |
connection c; |
|
23 |
select @@innodb_lock_wait_timeout; |
|
24 |
connection default; |
|
25 |
disconnect c; |
|
26 |
||
27 |
connection a; |
|
28 |
create table t1(a int primary key)engine=innodb; |
|
29 |
begin; |
|
30 |
insert into t1 values(1),(2),(3); |
|
31 |
||
32 |
connection b; |
|
33 |
--send |
|
34 |
select * from t1 for update; |
|
35 |
||
36 |
connection a; |
|
37 |
commit; |
|
38 |
||
39 |
connection b; |
|
40 |
reap; |
|
41 |
||
42 |
connection a; |
|
43 |
begin; |
|
44 |
insert into t1 values(4); |
|
45 |
||
46 |
connection b; |
|
47 |
--send |
|
48 |
select * from t1 for update; |
|
49 |
||
50 |
connection a; |
|
51 |
sleep 2; |
|
52 |
commit; |
|
53 |
||
54 |
connection b; |
|
55 |
--error ER_LOCK_WAIT_TIMEOUT |
|
56 |
reap; |
|
57 |
drop table t1; |
|
58 |
||
59 |
connection default; |
|
60 |
||
61 |
disconnect a; |
|
62 |
disconnect b; |
|
63 |
||
64 |
eval set global innodb_lock_wait_timeout=$timeout; |