blob: a05b5a912fe334f280c99cd6fdd62c4a640bb76b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
DROP TABLE IF EXISTS t1;
SET autocommit=0;
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
SHOW GLOBAL VARIABLES LIKE 'innodb_kill_idle_transaction';
Variable_name Value
innodb_kill_idle_transaction 0
SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='innodb_kill_idle_transaction';
VARIABLE_NAME VARIABLE_VALUE
INNODB_KILL_IDLE_TRANSACTION 0
SET GLOBAL innodb_kill_idle_transaction=1;
SHOW GLOBAL VARIABLES LIKE 'innodb_kill_idle_transaction';
Variable_name Value
innodb_kill_idle_transaction 1
SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='innodb_kill_idle_transaction';
VARIABLE_NAME VARIABLE_VALUE
INNODB_KILL_IDLE_TRANSACTION 1
BEGIN;
INSERT INTO t1 VALUES (1),(2),(3);
COMMIT;
SELECT * FROM t1;
a
1
2
3
BEGIN;
INSERT INTO t1 VALUES (4),(5),(6);
SELECT * FROM t1;
ERROR HY000: MySQL server has gone away
SELECT * FROM t1;
a
1
2
3
DROP TABLE t1;
SET GLOBAL innodb_kill_idle_transaction=0;
SHOW GLOBAL VARIABLES LIKE 'innodb_kill_idle_transaction';
Variable_name Value
innodb_kill_idle_transaction 0
SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='innodb_kill_idle_transaction';
VARIABLE_NAME VARIABLE_VALUE
INNODB_KILL_IDLE_TRANSACTION 0
|