Debian Codegraph @

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

raw
1 ############## mysql-test\t\wait_timeout_basic.test ###########################
2 # #
3 # Variable Name: wait_timeout #
4 # Scope: GLOBAL | SESSION #
5 # Access Type: Dynamic #
6 # Data Type: numeric #
7 # Default Value: #
8 # Range: #
9 # #
10 # #
11 # Creation Date: 2008-02-07 #
12 # Author: Sharique Abdullah #
13 # #
14 # Description: Test Cases of Dynamic System Variable wait_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#option_mysqld_wait_timeouts #
23 # #
24 ###############################################################################
25 # Due to differnces between linux and windows in the results
26
27 --source include/not_windows.inc
28 --source include/load_sysvars.inc
29
30 ############################################################
31 # START OF wait_timeout TESTS #
32 ############################################################
33
34 #############################################################
35 # Save initial value #
36 #############################################################
37
38 SET @start_global_value = @@global.wait_timeout;
39 SET @start_session_value = @@session.wait_timeout;
40
41 --echo '#--------------------FN_DYNVARS_005_01-------------------------#'
42 ############################################################
43 # Display the DEFAULT value of wait_timeout #
44 ############################################################
45
46 SET @@global.wait_timeout = 100;
47 SET @@global.wait_timeout = DEFAULT;
48 SELECT @@global.wait_timeout;
49
50 SET @@session.wait_timeout = 200;
51 SET @@session.wait_timeout = DEFAULT;
52 SELECT @@session.wait_timeout;
53
54
55 --echo '#--------------------FN_DYNVARS_005_02-------------------------#'
56 ############################################################
57 # Check the DEFAULT value of wait_timeout #
58 ############################################################
59
60 SET @@global.wait_timeout = DEFAULT;
61 SELECT @@global.wait_timeout = @default_wait_timeout;
62
63 SET @@session.wait_timeout = DEFAULT;
64 SELECT @@session.wait_timeout = @default_wait_timeout;
65
66
67
68 --echo '#--------------------FN_DYNVARS_005_03-------------------------#'
69 ######################################################################
70 # Change the value of wait_timeout to a valid value for GLOBAL Scope #
71 ######################################################################
72
73 #SET @@global.wait_timeout= @min_wait_timeout;
74 SET @@global.wait_timeout= 1;
75 SELECT @@global.wait_timeout;
76
77 SET @@global.wait_timeout = 60020;
78 SELECT @@global.wait_timeout;
79
80 #SET @@global.wait_timeout = @max_wait_timeout;
81 SET @@global.wait_timeout = 31536000;
82 SELECT @@global.wait_timeout = @max_wait_timeout;
83
84
85 --echo '#--------------------FN_DYNVARS_005_04-------------------------#'
86 #######################################################################
87 # Change the value of wait_timeout to a valid value for SESSION Scope #
88 #######################################################################
89 #SET @@session.wait_timeout = @min_wait_timeout;
90 #SELECT @@session.wait_timeout;
91
92 SET @@session.wait_timeout =6000;
93 SELECT @@session.wait_timeout;
94
95 #SET @@session.wait_timeout = @max_wait_timeout;
96 #SELECT @@session.wait_timeout = @max_wait_timeout;
97
98
99 --echo '#------------------FN_DYNVARS_005_05-----------------------#'
100 ########################################################
101 # Change the value of wait_timeout to an invalid value #
102 ########################################################
103
104 SET @@global.wait_timeout = 0;
105 SELECT @@global.wait_timeout;
106 SET @@global.wait_timeout = -1024;
107 SELECT @@global.wait_timeout;
108 SET @@global.wait_timeout = 123456789031;
109 SELECT @@global.wait_timeout;
110 SET @@global.wait_timeout = 31536003;
111 SELECT @@global.wait_timeout;
112 --Error ER_WRONG_TYPE_FOR_VAR
113 SET @@global.wait_timeout = ' ';
114 SELECT @@global.wait_timeout;
115
116 --Error ER_WRONG_TYPE_FOR_VAR
117 SET @@global.wait_timeout = ON;
118
119 --Error ER_WRONG_TYPE_FOR_VAR
120 SET @@global.wait_timeout = OFF;
121
122 SET @@global.wait_timeout = True;
123 SELECT @@global.wait_timeout;
124
125 SET @@global.wait_timeout = False;
126 SELECT @@global.wait_timeout;
127 --Error ER_WRONG_TYPE_FOR_VAR
128 SET @@global.wait_timeout = 65530.34;
129 SELECT @@global.wait_timeout;
130
131 --Error ER_WRONG_TYPE_FOR_VAR
132 SET @@global.wait_timeout ="Test";
133
134
135 --Error ER_WRONG_TYPE_FOR_VAR
136 SET @@session.wait_timeout = ON;
137
138
139 --Error ER_WRONG_TYPE_FOR_VAR
140 SET @@session.wait_timeout = OFF;
141
142 SET @@session.wait_timeout = True;
143 SELECT @@session.wait_timeout;
144
145 SET @@session.wait_timeout = False;
146 SELECT @@session.wait_timeout;
147
148
149 --Error ER_WRONG_TYPE_FOR_VAR
150 SET @@session.wait_timeout = "Test";
151 --Error ER_WRONG_TYPE_FOR_VAR
152 SET @@session.wait_timeout = 65530.34;
153 SELECT @@session.wait_timeout;
154 --Error ER_WRONG_TYPE_FOR_VAR
155 SET @@session.wait_timeout = 'test';
156 SET @@session.wait_timeout = 0;
157 SELECT @@session.wait_timeout;
158 # Truncated timeout may result in shorter timeouts that
159 # expire so comment out the below statements.
160 # SET @@session.wait_timeout = 123456789031;
161 SELECT @@session.wait_timeout = @max_wait_timeout;
162 # SET @@session.wait_timeout = -1;
163 SELECT @@session.wait_timeout;
164 --Error ER_WRONG_TYPE_FOR_VAR
165 SET @@session.wait_timeout = ' ';
166 SELECT @@session.wait_timeout;
167
168
169 --echo '#------------------FN_DYNVARS_005_06-----------------------#'
170 ####################################################################
171 # Check if the value in GLOBAL Table matches value in variable #
172 ####################################################################
173
174 --disable_warnings
175 SELECT @@global.wait_timeout = VARIABLE_VALUE
176 FROM performance_schema.global_variables
177 WHERE VARIABLE_NAME='wait_timeout';
178 --enable_warnings
179
180 --echo '#------------------FN_DYNVARS_005_07-----------------------#'
181 ####################################################################
182 # Check if the value in SESSION Table matches value in variable #
183 ####################################################################
184
185 --disable_warnings
186 SELECT @@session.wait_timeout = VARIABLE_VALUE
187 FROM performance_schema.session_variables
188 WHERE VARIABLE_NAME='wait_timeout';
189 --enable_warnings
190
191 --echo '#---------------------FN_DYNVARS_001_09----------------------#'
192 ###########################################################################
193 # Check if global and session variable are independent of each other #
194 ###########################################################################
195
196 SET @@global.wait_timeout = 30000;
197 SET @@global.wait_timeout = 40000;
198 SELECT @@wait_timeout = @@global.wait_timeout;
199
200 --echo '#---------------------FN_DYNVARS_001_10----------------------#'
201 ########################################################################
202 # Check if accessing variable with SESSION,LOCAL and without SCOPE #
203 # points to same session variable #
204 ########################################################################
205
206 SET @@wait_timeout = 100;
207 SELECT @@wait_timeout = @@local.wait_timeout;
208 SELECT @@local.wait_timeout = @@session.wait_timeout;
209
210 --echo '#---------------------FN_DYNVARS_001_11----------------------#'
211 #######################################################################
212 # Check if wait_timeout can be accessed with and without @@ sign #
213 #######################################################################
214
215 SET wait_timeout = 1027;
216 SELECT @@wait_timeout;
217
218
219 --Error ER_UNKNOWN_TABLE
220 SELECT local.wait_timeout;
221
222 --Error ER_UNKNOWN_TABLE
223 SELECT session.wait_timeout;
224
225 --Error ER_BAD_FIELD_ERROR
226 SELECT wait_timeout = @@session.wait_timeout;
227
228
229 ####################################
230 # Restore initial value #
231 ####################################
232
233 SET @@global.wait_timeout = @start_global_value;
234 SET @@session.wait_timeout = @start_session_value;
235
236 #################################################
237 # END OF wait_timeout TESTS #
238 #################################################