blob: a624a0c5923dc6f0590fd35211d2612ae055dbd1 (
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
|
drop table if exists t1;
## Creating new table t1 ##
CREATE TABLE t1
(
id INT NOT NULL auto_increment,
PRIMARY KEY (id),
name VARCHAR(30)
);
SET @old_wait_timeout = @@global.wait_timeout;
'#--------------------FN_DYNVARS_186_01-------------------------#'
## Creating new connection test_con1 ##
## Setting value of variable to 5 ##
SET @@session.wait_timeout = 5;
## Inserting record in table t1 ##
INSERT into t1(name) values('Record_1');
## Using sleep to check timeout ##
'#--------------------FN_DYNVARS_186_02-------------------------#'
## Setting value of variable ##
SET @@global.wait_timeout = 5;
## Creating new connection test_con2 ##
INSERT into t1(name) values('Record_2');
## Using sleep to check timeout ##
'#--------------------FN_DYNVARS_186_03-------------------------#'
## Setting value of variable to 1 ##
SET @@global.wait_timeout = 1;
## Creating new connection ##
INSERT into t1(name) values('Record_3');
## Using sleep to check timeout ##
## We cannot test it further because the server closes the connection due to wait_timeout ##
SELECT * from t1;
ERROR HY000: MySQL server has gone away
DROP TABLE t1;
SET @@global.wait_timeout = @old_wait_timeout;
|