| 1 |
drop table if exists t1; |
| 2 |
## Creating new table t1 ## |
| 3 |
CREATE TABLE t1 |
| 4 |
( |
| 5 |
id INT NOT NULL auto_increment, |
| 6 |
PRIMARY KEY (id), |
| 7 |
name VARCHAR(30) |
| 8 |
); |
| 9 |
'#--------------------FN_DYNVARS_052_01-------------------------#' |
| 10 |
## Setting initial value of variable to 1 ## |
| 11 |
SET @@global.interactive_timeout = 1; |
| 12 |
## Creating new connection test_con1 ## |
| 13 |
## Inserting record in table ## |
| 14 |
INSERT into t1(name) values('Record_1'); |
| 15 |
## Setting session value of interactive_timeout ## |
| 16 |
SET @@session.interactive_timeout = 1; |
| 17 |
## Verifying values of variable ## |
| 18 |
SELECT @@session.interactive_timeout; |
| 19 |
@@session.interactive_timeout |
| 20 |
1 |
| 21 |
SELECT @@global.interactive_timeout; |
| 22 |
@@global.interactive_timeout |
| 23 |
1 |
| 24 |
connection default; |
| 25 |
## Using sleep to check timeout ## |
| 26 |
sleep 2; |
| 27 |
connection test_con1; |
| 28 |
SELECT * from t1; |
| 29 |
id name |
| 30 |
1 Record_1 |
| 31 |
INSERT into t1(name) values('Record_2'); |
| 32 |
connection default; |
| 33 |
disconnect test_con1; |
| 34 |
DROP TABLE t1; |
| 35 |
SET @@global.interactive_timeout= 28800; |