Debian Codegraph @

mysql-test/suite/sys_vars/t/interactive_timeout_func.test

raw
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
27 drop table if exists t1;
28 --enable_warnings
29
30 ##############################
31 # Creating two new tables #
32 ##############################
33
34 --echo ## Creating new table t1 ##
35 CREATE TABLE t1
36 (
37 id INT NOT NULL auto_increment,
38 PRIMARY KEY (id),
39 name 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 #######################################################################
48 let $start_value= `SELECT @@global.interactive_timeout`;
49
50 --echo ## Setting initial value of variable to 1 ##
51 SET @@global.interactive_timeout = 1;
52
53 --echo ## Creating new connection test_con1 ##
54 # Not yet possible to set CLEAN_INTERACTIVE flag
55 connect (test_con1, localhost, root,,,,,);
56 connection test_con1;
57
58 --echo ## Inserting record in table ##
59 INSERT into t1(name) values('Record_1');
60
61 --echo ## Setting session value of interactive_timeout ##
62 SET @@session.interactive_timeout = 1;
63
64 --echo ## Verifying values of variable ##
65 SELECT @@session.interactive_timeout;
66 SELECT @@global.interactive_timeout;
67
68 --echo connection default;
69 connection default;
70 --echo ## Using sleep to check timeout ##
71 --echo sleep 2;
72 sleep 2;
73
74 --echo connection test_con1;
75 connection test_con1;
76 SELECT * from t1;
77
78 INSERT into t1(name) values('Record_2');
79
80 --echo connection default;
81 connection default;
82
83 --echo disconnect test_con1;
84 disconnect test_con1;
85 DROP TABLE t1;
86
87 eval SET @@global.interactive_timeout= $start_value;
88