1################################################################################
2#                                                                              #
3# Variable Name: interactive_timeout                                           #
4# Scope: GLOBAL | SESSION                                                      #
5# Access Type: Dynamic                                                         #
6# Data Type: numeric                                                           #
7# Default Value:28800                                                          #
8# Minvalue: 1                                                                  #
9#                                                                              #
10#                                                                              #
11# Creation Date: 2008-03-07                                                    #
12# Author:  Salman Rawala                                                       #
13#                                                                              #
14# Description: Test Cases of Dynamic System Variable interactive_timeout       #
15#              that checks the functionality of this variable                  #
16# Modified: HHunger 2009-02-26 Inserted clean up, beautifications.             #
17#                              It is not yet possible to set CLIENT_INTERACIVE #
18#                              When connecting, so the test has not the        #
19#                              desired effect. See 'wait_timeout_func'.        #
20# Reference:                                                                   #
21# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html          #
22#                                                                              #
23################################################################################
24
25
26--disable_warnings
27drop table if exists t1;
28--enable_warnings
29
30##############################
31#   Creating two new tables  #
32##############################
33
34--echo ## Creating new table t1 ##
35CREATE TABLE t1
36(
37id INT NOT NULL auto_increment,
38PRIMARY KEY (id),
39name VARCHAR(30)
40);
41
42
43--echo '#--------------------FN_DYNVARS_052_01-------------------------#'
44#######################################################################
45#   Setting initial value of interactive_timeout to 1 and verifying its
46#   behavior
47#######################################################################
48let $start_value= `SELECT @@global.interactive_timeout`;
49
50--echo ## Setting initial value of variable to 1 ##
51SET @@global.interactive_timeout = 1;
52
53--echo ## Creating new connection test_con1 ##
54# Not yet possible to set CLEAN_INTERACTIVE flag
55connect (test_con1, localhost, root,,,,,);
56connection test_con1;
57
58--echo ## Inserting record in table ##
59INSERT into t1(name) values('Record_1');
60
61--echo ## Setting session value of interactive_timeout ##
62SET @@session.interactive_timeout = 1;
63
64--echo ## Verifying values of variable ##
65SELECT @@session.interactive_timeout;
66SELECT @@global.interactive_timeout;
67
68--echo connection default;
69connection default;
70--echo ## Using sleep to check timeout ##
71--echo sleep 2;
72sleep 2;
73
74--echo connection test_con1;
75connection test_con1;
76SELECT * from t1;
77
78INSERT into t1(name) values('Record_2');
79
80--echo connection default;
81connection default;
82
83--echo disconnect test_con1;
84disconnect test_con1;
85DROP TABLE t1;
86
87eval SET @@global.interactive_timeout= $start_value;
88
89