Debian Codegraph @

mysql-test/suite/innodb/r/innodb-timeout.result

raw
1 set global innodb_lock_wait_timeout=42;
2 connect a,localhost,root,,;
3 connect b,localhost,root,,;
4 connection a;
5 select @@innodb_lock_wait_timeout;
6 @@innodb_lock_wait_timeout
7 42
8 set innodb_lock_wait_timeout=1;
9 select @@innodb_lock_wait_timeout;
10 @@innodb_lock_wait_timeout
11 1
12 connection b;
13 select @@innodb_lock_wait_timeout;
14 @@innodb_lock_wait_timeout
15 42
16 set global innodb_lock_wait_timeout=347;
17 select @@innodb_lock_wait_timeout;
18 @@innodb_lock_wait_timeout
19 42
20 set innodb_lock_wait_timeout=10;
21 select @@innodb_lock_wait_timeout;
22 @@innodb_lock_wait_timeout
23 10
24 connect c,localhost,root,,;
25 connection c;
26 select @@innodb_lock_wait_timeout;
27 @@innodb_lock_wait_timeout
28 347
29 disconnect c;
30 connection a;
31 SET @connection_b_id = <connection_b_id>;
32 create table t1(a int primary key)engine=innodb;
33 begin;
34 insert into t1 values(1),(2),(3);
35 connection b;
36 select * from t1 for update;
37 connection a;
38 commit;
39 connection b;
40 a
41 1
42 2
43 3
44 connection a;
45 begin;
46 insert into t1 values(4);
47 connection b;
48 set innodb_lock_wait_timeout=3;
49 select * from t1 for update;
50 connection a;
51 commit;
52 connection b;
53 ERROR HY000: Lock wait timeout exceeded; try restarting transaction
54 disconnect b;
55 connection a;
56 disconnect a;
57 connection default;
58 drop table t1;
59 set global innodb_lock_wait_timeout=<initial_timeout>;
60 #
61 # MDEV-11379 - AliSQL: [Feature] Issue#8: SELECT FOR UPDATE WAIT
62 #
63 CREATE TABLE t1 (c1 INT, c2 INT) ENGINE=InnoDB;
64 INSERT INTO t1 (c1,c2) values (1,1),(2,2),(3,3),(4,4);
65 CREATE VIEW v1 AS SELECT * FROM t1 WHERE c1=4 FOR UPDATE NOWAIT;
66 ERROR HY000: View's SELECT contains a '[NO]WAIT' clause
67 CREATE VIEW v1 AS SELECT * FROM t1 WHERE c1=4 FOR UPDATE WAIT 0;
68 ERROR HY000: View's SELECT contains a '[NO]WAIT' clause
69 CREATE PROCEDURE p1() SELECT * FROM t1 WHERE c1=4 FOR UPDATE NOWAIT;
70 ERROR 0A000: [NO]WAIT is not allowed in stored procedures
71 CREATE PROCEDURE p1() SELECT * FROM t1 WHERE c1=4 FOR UPDATE WAIT 0;
72 ERROR 0A000: [NO]WAIT is not allowed in stored procedures
73 connect con1,localhost,root,,;
74 LOCK TABLE t1 WRITE;
75 connect con2,localhost,root,,;
76 SELECT * FROM t1 WHERE c1=4 FOR UPDATE NOWAIT;
77 ERROR HY000: Lock wait timeout exceeded; try restarting transaction
78 SELECT * FROM t1 WHERE c1=4 FOR UPDATE WAIT 0;
79 ERROR HY000: Lock wait timeout exceeded; try restarting transaction
80 PREPARE stmt FROM 'SELECT * FROM t1 WHERE c1=4 FOR UPDATE NOWAIT';
81 EXECUTE stmt;
82 ERROR HY000: Lock wait timeout exceeded; try restarting transaction
83 DEALLOCATE PREPARE stmt;
84 PREPARE stmt FROM 'SELECT * FROM t1 WHERE c1=4 FOR UPDATE WAIT 0';
85 EXECUTE stmt;
86 ERROR HY000: Lock wait timeout exceeded; try restarting transaction
87 DEALLOCATE PREPARE stmt;
88 connection con1;
89 INSERT INTO t1 VALUES(5,5);
90 UNLOCK TABLES;
91 set AUTOCOMMIT=0;
92 SELECT * FROM t1 WHERE c1=4 FOR UPDATE;
93 connection con2;
94 set AUTOCOMMIT=0;
95 SET INNODB_LOCK_WAIT_TIMEOUT=1;
96 SELECT * FROM t1 WHERE c1=4 FOR UPDATE;
97 ERROR HY000: Lock wait timeout exceeded; try restarting transaction
98 SELECT * FROM t1 WHERE c1=4 FOR UPDATE NOWAIT;
99 ERROR HY000: Lock wait timeout exceeded; try restarting transaction
100 SELECT * FROM t1 WHERE c1=4 FOR UPDATE WAIT 0;
101 ERROR HY000: Lock wait timeout exceeded; try restarting transaction
102 connection con1;
103 UPDATE t1 SET c2=5 WHERE c1=4;
104 COMMIT;
105 set AUTOCOMMIT=0;
106 SELECT * FROM t1 WHERE c1=4 FOR UPDATE;
107 c1 c2
108 4 5
109 connection con2;
110 set AUTOCOMMIT=0;
111 SET INNODB_LOCK_WAIT_TIMEOUT=1;
112 SELECT * FROM t1 WHERE c1=4 FOR UPDATE WAIT 10;
113 connection con1;
114 COMMIT;
115 connection con2;
116 disconnect con1;
117 disconnect con2;
118 connection default;
119 DROP TABLE t1;