1
drop table if exists t1;
2
## Creating new table t1 ##
5
id INT NOT NULL auto_increment,
1
SET @start_value= @@global.wait_timeout;
9
2
'#--------------------FN_DYNVARS_186_01-------------------------#'
10
## Creating new connection test_con1 ##
11
## Setting value of variable to 5 ##
12
SET @@session.wait_timeout = 5;
13
## Inserting record in table t1 ##
14
INSERT into t1(name) values('Record_1');
15
## Using sleep to check timeout ##
16
'#--------------------FN_DYNVARS_186_02-------------------------#'
17
## Setting value of variable ##
18
SET @@global.wait_timeout = 5;
19
## Creating new connection test_con2 ##
20
INSERT into t1(name) values('Record_2');
21
## Using sleep to check timeout ##
3
SET @start_time= UNIX_TIMESTAMP();
4
connect (test_con1, localhost, root,,);
5
SELECT @@session.wait_timeout = @@global.wait_timeout AS 'Expect 1';
8
SET @@session.wait_timeout = <session_value>;
9
connect (test_con2, localhost, root,,);
10
SET @@session.wait_timeout = <session_value> - 1;
12
wait until connections ready
13
SELECT info FROM information_schema.processlist;
15
SELECT info FROM information_schema.processlist
22
16
'#--------------------FN_DYNVARS_186_03-------------------------#'
23
## Setting value of variable to 1 ##
24
SET @@global.wait_timeout = 1;
25
## Creating new connection ##
26
INSERT into t1(name) values('Record_3');
27
## Using sleep to check timeout ##
28
## We cannot test it further because the server stops due to wait_timeout ##
30
ERROR HY000: MySQL server has gone away
17
SET @@global.wait_timeout= <global_value>;
18
SELECT @@session.wait_timeout = @start_value AS 'Expect 1';
21
connect (test_con3, localhost, root,,);
22
SELECT @@session.wait_timeout = @@global.wait_timeout AS 'Expect 1';
26
SELECT info FROM information_schema.processlist;
28
SELECT info FROM information_schema.processlist
29
SELECT UNIX_TIMESTAMP() - @start_time >= <global_value> + <session_value>;;
30
UNIX_TIMESTAMP() - @start_time >= <global_value> + <session_value>;
32
SET @@global.wait_timeout= @start_value;