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 # Not yet possible to set CLEAN_INTERACTIVE flag
54 connect (test_con1, localhost, root,,,,,);
55 connection test_con1;
56
57 --echo ## Inserting record in table ##
58 INSERT into t1(name) values('Record_1');
59
60 --echo ## Setting session value of interactive_timeout ##
61 SET @@session.interactive_timeout = 1;
62
63 --echo ## Verifying values of variable ##
64 SELECT @@session.interactive_timeout;
65 SELECT @@global.interactive_timeout;
66
67 connection default;
68 --echo ## Using sleep to check timeout ##
69 --echo sleep 2;
70 sleep 2;
71
72 connection test_con1;
73 SELECT * from t1;
74
75 INSERT into t1(name) values('Record_2');
76
77 connection default;
78
79 disconnect test_con1;
80 DROP TABLE t1;
81
82 eval SET @@global.interactive_timeout= $start_value;