1
############## mysql-test\t\wait_timeout_func.test ############################
3
# Variable Name: wait_timeout #
4
# Scope: GLOBAL | SESSION #
5
# Access Type: Dynamic #
11
# Creation Date: 2008-03-07 #
12
# Author: Salman Rawala #
14
# Description: Test Cases of Dynamic System Variable wait_timeout #
15
# that checks the functionality of this variable #
17
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
18
# server-system-variables.html#option_mysqld_wait_timeouts #
20
###############################################################################
22
--source include/not_embedded.inc
25
drop table if exists t1;
28
##############################
29
# Creating two new tables #
30
##############################
32
--echo ## Creating new table t1 ##
35
id INT NOT NULL auto_increment,
41
--echo '#--------------------FN_DYNVARS_186_01-------------------------#'
42
#######################################################################
43
# Setting initial value of interactive_timeout greater than sleep and
44
# verifying its behavior on session scope
45
#######################################################################
47
--echo ## Creating new connection test_con1 ##
48
connect (test_con1, localhost, root,,);
51
--echo ## Setting value of variable to 5 ##
52
SET @@session.wait_timeout = 5;
54
--echo ## Inserting record in table t1 ##
55
INSERT into t1(name) values('Record_1');
57
--echo ## Using sleep to check timeout ##
61
--echo '#--------------------FN_DYNVARS_186_02-------------------------#'
62
#######################################################################
63
# Setting initial value of interactive_timeout greater than sleep and
64
# verifying its behavior on global scope
65
#######################################################################
67
--echo ## Setting value of variable ##
68
SET @@global.wait_timeout = 5;
70
--echo ## Creating new connection test_con2 ##
71
connect (test_con2, localhost, root,,);
74
INSERT into t1(name) values('Record_2');
76
--echo ## Using sleep to check timeout ##
82
--echo '#--------------------FN_DYNVARS_186_03-------------------------#'
83
#######################################################################
84
# Setting initial value of interactive_timeout less than sleep and
85
# verifying its behavior on global scope
86
#######################################################################
88
--echo ## Setting value of variable to 1 ##
89
SET @@global.wait_timeout = 1;
91
--echo ## Creating new connection ##
92
connect (test_con3, localhost, root,,);
95
INSERT into t1(name) values('Record_3');
97
--echo ## Using sleep to check timeout ##
100
--echo ## We cannot test it further because the server stops due to wait_timeout ##