Debian Codegraph @

mysql-test/suite/sys_vars/inc/max_seeks_for_key_basic.inc

raw
1 ################### mysql-test\t\max_seeks_for_key_basic.test ###################
2 # #
3 # Variable Name: max_seeks_for_key #
4 # Scope: GLOBAL | SESSION #
5 # Access Type: Dynamic #
6 # Data Type: numeric #
7 # Default Value: 4294967295/18446744073709551615 #
8 # Range: 1 - 4294967295/18446744073709551615 #
9 # #
10 # #
11 # Creation Date: 2008-02-07 #
12 # Author: Salman #
13 # #
14 # Description: Test Cases of Dynamic System Variable max_seeks_for_key #
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 # Modified: Pavan Naik, 2015-11-24 #
22 # Added boundary value test cases according to the type of the #
23 # server binary. #
24 # #
25 # Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
26 # server-system-variables.html #
27 # #
28 #################################################################################
29
30 --source include/load_sysvars.inc
31
32 #################################################################
33 # START OF max_seeks_for_key TESTS #
34 #################################################################
35
36
37 #############################################################
38 # Save initial value #
39 #############################################################
40
41 SET @start_global_value = @@global.max_seeks_for_key;
42
43 if($mach64)
44 {
45 # Bug#11752618 - 64-BIT WINDOWS VARIABLES LIMITED TO DIFFERENT VALUES THAN 64-BIT LINUX/SO
46 let $machine_name = `SELECT CONVERT(@@version_compile_os using latin1) IN ("Win64", "Windows")`;
47
48 if($machine_name)
49 {
50 --replace_result 4294967295 18446744073709551615
51 }
52 }
53 SELECT @start_global_value;
54
55 SET @start_session_value = @@session.max_seeks_for_key;
56
57 if($mach64)
58 {
59 # Bug#11752618 - 64-BIT WINDOWS VARIABLES LIMITED TO DIFFERENT VALUES THAN 64-BIT LINUX/SO
60 if($machine_name)
61 {
62 --replace_result 4294967295 18446744073709551615
63 }
64 }
65 SELECT @start_session_value;
66
67 --echo '#--------------------FN_DYNVARS_083_01-------------------------#'
68 #################################################################
69 # Display the DEFAULT value of max_seeks_for_key #
70 #################################################################
71
72 SET @@global.max_seeks_for_key = 100;
73 SET @@global.max_seeks_for_key = DEFAULT;
74
75 if($mach64)
76 {
77 # Bug#11752618 - 64-BIT WINDOWS VARIABLES LIMITED TO DIFFERENT VALUES THAN 64-BIT LINUX/SO
78 if($machine_name)
79 {
80 --replace_result 4294967295 18446744073709551615
81 }
82 }
83 SELECT @@global.max_seeks_for_key;
84
85 SET @@session.max_seeks_for_key = 200;
86 SET @@session.max_seeks_for_key = DEFAULT;
87
88 if($mach64)
89 {
90 # Bug#11752618 - 64-BIT WINDOWS VARIABLES LIMITED TO DIFFERENT VALUES THAN 64-BIT LINUX/SO
91 if($machine_name)
92 {
93 --replace_result 4294967295 18446744073709551615
94 }
95 }
96 SELECT @@session.max_seeks_for_key;
97
98
99 --echo '#--------------------FN_DYNVARS_083_02-------------------------#'
100 #################################################################
101 # Check the DEFAULT value of max_seeks_for_key #
102 #################################################################
103
104 SET @@global.max_seeks_for_key = DEFAULT;
105
106 # Bug#11752618 - 64-BIT WINDOWS VARIABLES LIMITED TO DIFFERENT VALUES THAN 64-BIT LINUX/SO
107 if($mach64)
108 {
109 if($machine_name)
110 {
111 --replace_result 1 0
112 }
113 }
114 SELECT @@global.max_seeks_for_key = 4294967295;
115
116 SET @@session.max_seeks_for_key = DEFAULT;
117
118 # Bug#11752618 - 64-BIT WINDOWS VARIABLES LIMITED TO DIFFERENT VALUES THAN 64-BIT LINUX/SO
119 if($mach64)
120 {
121 if($machine_name)
122 {
123 --replace_result 1 0
124 }
125 }
126 SELECT @@session.max_seeks_for_key = 4294967295;
127
128
129 --echo '#--------------------FN_DYNVARS_083_03-------------------------#'
130 ###########################################################################
131 # Change the value of max_seeks_for_key to a valid value for GLOBAL Scope #
132 ###########################################################################
133
134 SET @@global.max_seeks_for_key = 1;
135 SELECT @@global.max_seeks_for_key;
136 SET @@global.max_seeks_for_key = 2;
137 SELECT @@global.max_seeks_for_key;
138 SET @@global.max_seeks_for_key = 65536;
139 SELECT @@global.max_seeks_for_key;
140 SET @@global.max_seeks_for_key = 4294967295;
141 SELECT @@global.max_seeks_for_key;
142 SET @@global.max_seeks_for_key = 4294967294;
143 SELECT @@global.max_seeks_for_key;
144
145 # Test cases for 64-bit machines
146 if($mach64)
147 {
148 --disable_warnings
149 SET @@global.max_seeks_for_key = 18446744073709551615;
150 --enable_warnings
151
152 # Bug#11752618 - 64-BIT WINDOWS VARIABLES LIMITED TO DIFFERENT VALUES THAN 64-BIT LINUX/SO
153 if($machine_name)
154 {
155 --replace_result 4294967295 18446744073709551615
156 }
157 SELECT @@global.max_seeks_for_key;
158 }
159
160 --echo '#--------------------FN_DYNVARS_083_04-------------------------#'
161 ############################################################################
162 # Change the value of max_seeks_for_key to a valid value for SESSION Scope #
163 ############################################################################
164 SET @@session.max_seeks_for_key = 1;
165 SELECT @@session.max_seeks_for_key;
166 SET @@session.max_seeks_for_key = 2;
167 SELECT @@session.max_seeks_for_key;
168 SET @@session.max_seeks_for_key = 4294967295;
169 SELECT @@session.max_seeks_for_key;
170 SET @@session.max_seeks_for_key = 4294967294;
171 SELECT @@session.max_seeks_for_key;
172 SET @@session.max_seeks_for_key = 65535;
173 SELECT @@session.max_seeks_for_key;
174
175 # Test cases for 64-bit machines
176 if($mach64)
177 {
178 --disable_warnings
179 SET @@session.max_seeks_for_key = 18446744073709551615;
180 --enable_warnings
181
182 # Bug#11752618 - 64-BIT WINDOWS VARIABLES LIMITED TO DIFFERENT VALUES THAN 64-BIT LINUX/SO
183 if($machine_name)
184 {
185 --replace_result 4294967295 18446744073709551615
186 }
187 SELECT @@session.max_seeks_for_key;
188 }
189
190 --echo '#------------------FN_DYNVARS_083_05-----------------------#'
191 #############################################################
192 # Change the value of max_seeks_for_key to an invalid value #
193 #############################################################
194
195 SET @@global.max_seeks_for_key = 0;
196 SELECT @@global.max_seeks_for_key;
197 SET @@global.max_seeks_for_key = -1024;
198 SELECT @@global.max_seeks_for_key;
199 --Error ER_WRONG_TYPE_FOR_VAR
200 SET @@global.max_seeks_for_key = 65530.34;
201 SELECT @@global.max_seeks_for_key;
202 --Error ER_WRONG_TYPE_FOR_VAR
203 SET @@global.max_seeks_for_key = test;
204 SELECT @@global.max_seeks_for_key;
205
206 if($mach32)
207 {
208 SET @@global.max_seeks_for_key = 4294967296;
209 SELECT @@global.max_seeks_for_key;
210
211 SET @@global.max_seeks_for_key = 42949672950;
212 SELECT @@global.max_seeks_for_key;
213 }
214
215 if($mach64)
216 {
217 --error ER_WRONG_TYPE_FOR_VAR
218 SET @@global.max_seeks_for_key = 18446744073709551616;
219 SELECT @@global.max_seeks_for_key;
220 }
221
222 SET @@session.max_seeks_for_key = 0;
223 SELECT @@session.max_seeks_for_key;
224 SET @@session.max_seeks_for_key = -2;
225 SELECT @@session.max_seeks_for_key;
226 --Error ER_WRONG_TYPE_FOR_VAR
227 SET @@session.max_seeks_for_key = 65530.34;
228
229 --Error ER_WRONG_TYPE_FOR_VAR
230 SET @@session.max_seeks_for_key = test;
231 SELECT @@session.max_seeks_for_key;
232
233 if($mach32)
234 {
235 SET @@session.max_seeks_for_key = 4294967296;
236 SELECT @@session.max_seeks_for_key;
237
238 SET @@session.max_seeks_for_key = 42949672950;
239 SELECT @@session.max_seeks_for_key;
240 }
241
242 if($mach64)
243 {
244 --error ER_WRONG_TYPE_FOR_VAR
245 SET @@session.max_seeks_for_key = 18446744073709551616;
246 SELECT @@session.max_seeks_for_key;
247 }
248
249 --echo '#------------------FN_DYNVARS_083_06-----------------------#'
250 ####################################################################
251 # Check if the value in GLOBAL Table matches value in variable #
252 ####################################################################
253
254 --disable_warnings
255 SELECT @@global.max_seeks_for_key = VARIABLE_VALUE
256 FROM performance_schema.global_variables
257 WHERE VARIABLE_NAME='max_seeks_for_key';
258 --enable_warnings
259
260 --echo '#------------------FN_DYNVARS_083_07-----------------------#'
261 ####################################################################
262 # Check if the value in SESSION Table matches value in variable #
263 ####################################################################
264
265 --disable_warnings
266 SELECT @@session.max_seeks_for_key = VARIABLE_VALUE
267 FROM performance_schema.session_variables
268 WHERE VARIABLE_NAME='max_seeks_for_key';
269 --enable_warnings
270
271 --echo '#------------------FN_DYNVARS_083_08-----------------------#'
272 ####################################################################
273 # Check if TRUE and FALSE values can be used on variable #
274 ####################################################################
275
276 SET @@global.max_seeks_for_key = TRUE;
277 SELECT @@global.max_seeks_for_key;
278 SET @@global.max_seeks_for_key = FALSE;
279 SELECT @@global.max_seeks_for_key;
280
281
282 --echo '#---------------------FN_DYNVARS_083_09----------------------#'
283 #################################################################################
284 # Check if accessing variable with and without GLOBAL point to same variable #
285 #################################################################################
286
287 SET @@global.max_seeks_for_key = 10;
288 SELECT @@max_seeks_for_key = @@global.max_seeks_for_key;
289
290
291 --echo '#---------------------FN_DYNVARS_083_10----------------------#'
292 ########################################################################################################
293 # Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
294 ########################################################################################################
295
296 SET @@max_seeks_for_key = 100;
297 SELECT @@max_seeks_for_key = @@local.max_seeks_for_key;
298 SELECT @@local.max_seeks_for_key = @@session.max_seeks_for_key;
299
300
301 --echo '#---------------------FN_DYNVARS_083_11----------------------#'
302 ############################################################################
303 # Check if max_seeks_for_key can be accessed with and without @@ sign #
304 ############################################################################
305
306 SET max_seeks_for_key = 1;
307 SELECT @@max_seeks_for_key;
308 --Error ER_UNKNOWN_TABLE
309 SELECT local.max_seeks_for_key;
310 --Error ER_UNKNOWN_TABLE
311 SELECT session.max_seeks_for_key;
312 --Error ER_BAD_FIELD_ERROR
313 SELECT max_seeks_for_key = @@session.max_seeks_for_key;
314
315
316 ####################################
317 # Restore initial value #
318 ####################################
319
320 SET @@global.max_seeks_for_key = @start_global_value;
321
322 if($mach64)
323 {
324 # Bug#11752618 - 64-BIT WINDOWS VARIABLES LIMITED TO DIFFERENT VALUES THAN 64-BIT LINUX/SO
325 if($machine_name)
326 {
327 --replace_result 4294967295 18446744073709551615
328 }
329 }
330 SELECT @@global.max_seeks_for_key;
331
332 SET @@session.max_seeks_for_key = @start_session_value;
333
334 if($mach64)
335 {
336 # Bug#11752618 - 64-BIT WINDOWS VARIABLES LIMITED TO DIFFERENT VALUES THAN 64-BIT LINUX/SO
337 if($machine_name)
338 {
339 --replace_result 4294967295 18446744073709551615
340 }
341 }
342 SELECT @@session.max_seeks_for_key;
343
344
345 #############################################################
346 # END OF max_seeks_for_key TESTS #
347 #############################################################
348