Debian Codegraph @

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

raw
1 ############## mysql-test\t\interactive_timeout_basic.test ###############
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-02-07 #
12 # Author: Salman #
13 # #
14 # Description: Test Cases of Dynamic System Variable interactive_timeout #
15 # that checks the behavior of this variable in the following ways#
16 # * Default Value #
17 # * Valid & Invalid values #
18 # * Scope & Access method #
19 # * Data Integrity #
20 # #
21 # Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
22 # server-system-variables.html #
23 # #
24 ###############################################################################
25
26 --source include/load_sysvars.inc
27
28
29 ###################################################################
30 # START OF interactive_timeout TESTS #
31 ###################################################################
32
33
34 #############################################################
35 # Save initial value #
36 #############################################################
37
38 SET @start_global_value = @@global.interactive_timeout;
39 SELECT @start_global_value;
40 SET @start_session_value = @@session.interactive_timeout;
41 SELECT @start_session_value;
42
43
44 --echo '#--------------------FN_DYNVARS_052_01-------------------------#'
45 ###################################################################
46 # Display the DEFAULT value of interactive_timeout #
47 ###################################################################
48
49 SET @@global.interactive_timeout = 100;
50 SET @@global.interactive_timeout = DEFAULT;
51 SELECT @@global.interactive_timeout;
52
53 SET @@session.interactive_timeout = 200;
54 SET @@session.interactive_timeout = DEFAULT;
55 SELECT @@session.interactive_timeout;
56
57
58 --echo '#--------------------FN_DYNVARS_052_02-------------------------#'
59 ###################################################################
60 # Check the DEFAULT value of interactive_timeout #
61 ###################################################################
62
63 SET @@global.interactive_timeout = DEFAULT;
64 SELECT @@global.interactive_timeout = 28800;
65
66 SET @@session.interactive_timeout = DEFAULT;
67 SELECT @@session.interactive_timeout = 28800;
68
69
70 --echo '#--------------------FN_DYNVARS_052_03-------------------------#'
71 #############################################################################
72 # Change the value of interactive_timeout to a valid value for GLOBAL Scope #
73 #############################################################################
74
75 SET @@global.interactive_timeout = 1;
76 SELECT @@global.interactive_timeout;
77 SET @@global.interactive_timeout = 60020;
78 SELECT @@global.interactive_timeout;
79 SET @@global.interactive_timeout = 65535;
80 SELECT @@global.interactive_timeout;
81
82
83 --echo '#--------------------FN_DYNVARS_052_04-------------------------#'
84 ##############################################################################
85 # Change the value of interactive_timeout to a valid value for SESSION Scope #
86 ##############################################################################
87
88 SET @@session.interactive_timeout = 1;
89 SELECT @@session.interactive_timeout;
90 SET @@session.interactive_timeout = 50050;
91 SELECT @@session.interactive_timeout;
92 SET @@session.interactive_timeout = 65535;
93 SELECT @@session.interactive_timeout;
94
95
96 --echo '#------------------FN_DYNVARS_052_05-----------------------#'
97 ###############################################################
98 # Change the value of interactive_timeout to an invalid value #
99 ###############################################################
100
101 SET @@global.interactive_timeout = 0;
102 SELECT @@global.interactive_timeout;
103 SET @@global.interactive_timeout = -1024;
104 SELECT @@global.interactive_timeout;
105 SET @@global.interactive_timeout = 1000000000;
106 SELECT @@global.interactive_timeout;
107 --Error ER_WRONG_TYPE_FOR_VAR
108 SET @@global.interactive_timeout = 65530.34;
109 SELECT @@global.interactive_timeout;
110 --Error ER_WRONG_TYPE_FOR_VAR
111 SET @@global.interactive_timeout = test;
112 SELECT @@global.interactive_timeout;
113
114 SET @@session.interactive_timeout = 0;
115 SELECT @@session.interactive_timeout;
116 SET @@session.interactive_timeout = -2;
117 SELECT @@session.interactive_timeout;
118 --Error ER_WRONG_TYPE_FOR_VAR
119 SET @@session.interactive_timeout = 65530.34;
120 SET @@session.interactive_timeout = 100000000;
121 SELECT @@session.interactive_timeout;
122
123 --Error ER_WRONG_TYPE_FOR_VAR
124 SET @@session.interactive_timeout = test;
125 SELECT @@session.interactive_timeout;
126
127
128 --echo '#------------------FN_DYNVARS_052_06-----------------------#'
129 ####################################################################
130 # Check if the value in GLOBAL Table matches value in variable #
131 ####################################################################
132
133
134 SELECT @@global.interactive_timeout = VARIABLE_VALUE
135 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
136 WHERE VARIABLE_NAME='interactive_timeout';
137
138 --echo '#------------------FN_DYNVARS_052_07-----------------------#'
139 ####################################################################
140 # Check if the value in SESSION Table matches value in variable #
141 ####################################################################
142
143 SELECT @@session.interactive_timeout = VARIABLE_VALUE
144 FROM INFORMATION_SCHEMA.SESSION_VARIABLES
145 WHERE VARIABLE_NAME='interactive_timeout';
146
147
148 --echo '#------------------FN_DYNVARS_052_08-----------------------#'
149 ####################################################################
150 # Check if TRUE and FALSE values can be used on variable #
151 ####################################################################
152
153 SET @@global.interactive_timeout = TRUE;
154 SELECT @@global.interactive_timeout;
155 SET @@global.interactive_timeout = FALSE;
156 SELECT @@global.interactive_timeout;
157
158
159 --echo '#---------------------FN_DYNVARS_052_09----------------------#'
160 #################################################################################
161 # Check if accessing variable with and without GLOBAL point to same variable #
162 #################################################################################
163
164 SET @@global.interactive_timeout = 10;
165 SELECT @@interactive_timeout = @@global.interactive_timeout;
166
167
168 --echo '#---------------------FN_DYNVARS_052_10----------------------#'
169 ########################################################################################################
170 # Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
171 ########################################################################################################
172
173 SET @@interactive_timeout = 100;
174 SELECT @@interactive_timeout = @@local.interactive_timeout;
175 SELECT @@local.interactive_timeout = @@session.interactive_timeout;
176
177
178 --echo '#---------------------FN_DYNVARS_052_11----------------------#'
179 ##############################################################################
180 # Check if interactive_timeout can be accessed with and without @@ sign #
181 ##############################################################################
182
183 SET interactive_timeout = 1;
184 SELECT @@interactive_timeout;
185 --Error ER_UNKNOWN_TABLE
186 SELECT local.interactive_timeout;
187 --Error ER_UNKNOWN_TABLE
188 SELECT session.interactive_timeout;
189 --Error ER_BAD_FIELD_ERROR
190 SELECT interactive_timeout = @@session.interactive_timeout;
191
192
193 ####################################
194 # Restore initial value #
195 ####################################
196
197 SET @@global.interactive_timeout = @start_global_value;
198 SELECT @@global.interactive_timeout;
199 SET @@session.interactive_timeout = @start_session_value;
200 SELECT @@session.interactive_timeout;
201
202
203 ########################################################
204 # END OF interactive_timeout TESTS #
205 ########################################################
206