Debian Codegraph @

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

raw
1 #################### mysql-test\t\net_retry_count_basic.test ####################
2 # #
3 # Variable Name: net_retry_count #
4 # Scope: GLOBAL | SESSION #
5 # Access Type: Dynamic #
6 # Data Type: numeric #
7 # Default Value: 10 #
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 net_retry_count #
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 net_retry_count TESTS #
34 ###############################################################
35
36
37 #############################################################
38 # Save initial value #
39 #############################################################
40
41 SET @start_global_value = @@global.net_retry_count;
42 SELECT @start_global_value;
43 SET @start_session_value = @@session.net_retry_count;
44 SELECT @start_session_value;
45
46
47 --echo '#--------------------FN_DYNVARS_111_01-------------------------#'
48 ###############################################################
49 # Display the DEFAULT value of net_retry_count #
50 ###############################################################
51
52 SET @@global.net_retry_count = 100;
53 SET @@global.net_retry_count = DEFAULT;
54 SELECT @@global.net_retry_count;
55
56 SET @@session.net_retry_count = 200;
57 SET @@session.net_retry_count = DEFAULT;
58 SELECT @@session.net_retry_count;
59
60
61 --echo '#--------------------FN_DYNVARS_111_02-------------------------#'
62 ###############################################################
63 # Check the DEFAULT value of net_retry_count #
64 ###############################################################
65
66 SET @@global.net_retry_count = DEFAULT;
67 SELECT @@global.net_retry_count = 10;
68
69 SET @@session.net_retry_count = DEFAULT;
70 SELECT @@session.net_retry_count = 10;
71
72
73 --echo '#--------------------FN_DYNVARS_111_03-------------------------#'
74 #########################################################################
75 # Change the value of net_retry_count to a valid value for GLOBAL Scope #
76 #########################################################################
77
78 SET @@global.net_retry_count = 1;
79 SELECT @@global.net_retry_count;
80 SET @@global.net_retry_count = 2;
81 SELECT @@global.net_retry_count;
82 SET @@global.net_retry_count = 4294967295;
83 SELECT @@global.net_retry_count;
84 SET @@global.net_retry_count = 4294967294;
85 SELECT @@global.net_retry_count;
86 SET @@global.net_retry_count = 65536;
87 SELECT @@global.net_retry_count;
88
89 # Test cases for 64-bit machines
90 if($mach64)
91 {
92 --disable_warnings
93 SET @@global.net_retry_count = 18446744073709551615;
94 --enable_warnings
95
96 # Bug#11752618 - 64-BIT WINDOWS VARIABLES LIMITED TO DIFFERENT VALUES THAN 64-BIT LINUX/SO
97 let $machine_name = `SELECT CONVERT(@@version_compile_os using latin1) IN ("Win64", "Windows")`;
98
99 if($machine_name)
100 {
101 --replace_result 4294967295 18446744073709551615
102 }
103 SELECT @@global.net_retry_count;
104 }
105
106 --echo '#--------------------FN_DYNVARS_111_04-------------------------#'
107 ##########################################################################
108 # Change the value of net_retry_count to a valid value for SESSION Scope #
109 ##########################################################################
110
111 SET @@session.net_retry_count = 1;
112 SELECT @@session.net_retry_count;
113 SET @@session.net_retry_count = 2;
114 SELECT @@session.net_retry_count;
115 SET @@session.net_retry_count = 65535;
116 SELECT @@session.net_retry_count;
117 SET @@session.net_retry_count = 4294967295;
118 SELECT @@session.net_retry_count;
119 SET @@session.net_retry_count = 4294967294;
120 SELECT @@session.net_retry_count;
121
122 # Test cases for 64-bit machines
123 if($mach64)
124 {
125 --disable_warnings
126 SET @@session.net_retry_count = 18446744073709551615;
127 --enable_warnings
128
129 # Bug#11752618 - 64-BIT WINDOWS VARIABLES LIMITED TO DIFFERENT VALUES THAN 64-BIT LINUX/SO
130 if($machine_name)
131 {
132 --replace_result 4294967295 18446744073709551615
133 }
134 SELECT @@session.net_retry_count;
135 }
136
137 --echo '#------------------FN_DYNVARS_111_05-----------------------#'
138 ###########################################################
139 # Change the value of net_retry_count to an invalid value #
140 ###########################################################
141
142 SET @@global.net_retry_count = 0;
143 SELECT @@global.net_retry_count;
144 SET @@global.net_retry_count = -1024;
145 SELECT @@global.net_retry_count;
146 --Error ER_WRONG_TYPE_FOR_VAR
147 SET @@global.net_retry_count = 65530.34;
148 SELECT @@global.net_retry_count;
149 --Error ER_WRONG_TYPE_FOR_VAR
150 SET @@global.net_retry_count = test;
151 SELECT @@global.net_retry_count;
152
153 if($mach32)
154 {
155 SET @@global.net_retry_count = 4294967296;
156 SELECT @@global.net_retry_count;
157
158 SET @@global.net_retry_count = 42949672950;
159 SELECT @@global.net_retry_count;
160 }
161
162 if($mach64)
163 {
164 --error ER_WRONG_TYPE_FOR_VAR
165 SET @@global.net_retry_count = 18446744073709551616;
166 SELECT @@global.net_retry_count;
167 }
168
169 SET @@session.net_retry_count = 0;
170 SELECT @@session.net_retry_count;
171 SET @@session.net_retry_count = -2;
172 SELECT @@session.net_retry_count;
173 --Error ER_WRONG_TYPE_FOR_VAR
174 SET @@session.net_retry_count = 65530.34;
175
176 --Error ER_WRONG_TYPE_FOR_VAR
177 SET @@session.net_retry_count = test;
178 SELECT @@session.net_retry_count;
179
180 if($mach32)
181 {
182 SET @@session.net_retry_count = 4294967296;
183 SELECT @@session.net_retry_count;
184
185 SET @@session.net_retry_count = 42949672950;
186 SELECT @@session.net_retry_count;
187 }
188
189 if($mach64)
190 {
191 --error ER_WRONG_TYPE_FOR_VAR
192 SET @@session.net_retry_count = 18446744073709551616;
193 SELECT @@session.net_retry_count;
194 }
195
196 --echo '#------------------FN_DYNVARS_111_06-----------------------#'
197 ####################################################################
198 # Check if the value in GLOBAL Table matches value in variable #
199 ####################################################################
200
201 --disable_warnings
202 SELECT @@global.net_retry_count = VARIABLE_VALUE
203 FROM performance_schema.global_variables
204 WHERE VARIABLE_NAME='net_retry_count';
205 --enable_warnings
206
207 --echo '#------------------FN_DYNVARS_111_07-----------------------#'
208 ####################################################################
209 # Check if the value in SESSION Table matches value in variable #
210 ####################################################################
211
212 --disable_warnings
213 SELECT @@session.net_retry_count = VARIABLE_VALUE
214 FROM performance_schema.session_variables
215 WHERE VARIABLE_NAME='net_retry_count';
216 --enable_warnings
217
218 --echo '#------------------FN_DYNVARS_111_08-----------------------#'
219 ####################################################################
220 # Check if TRUE and FALSE values can be used on variable #
221 ####################################################################
222
223 SET @@global.net_retry_count = TRUE;
224 SELECT @@global.net_retry_count;
225 SET @@global.net_retry_count = FALSE;
226 SELECT @@global.net_retry_count;
227
228
229 --echo '#---------------------FN_DYNVARS_111_09----------------------#'
230 #################################################################################
231 # Check if accessing variable with and without GLOBAL point to same variable #
232 #################################################################################
233
234 SET @@global.net_retry_count = 10;
235 SELECT @@net_retry_count = @@global.net_retry_count;
236
237
238 --echo '#---------------------FN_DYNVARS_111_10----------------------#'
239 ########################################################################################################
240 # Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
241 ########################################################################################################
242
243 SET @@net_retry_count = 100;
244 SELECT @@net_retry_count = @@local.net_retry_count;
245 SELECT @@local.net_retry_count = @@session.net_retry_count;
246
247
248 --echo '#---------------------FN_DYNVARS_111_11----------------------#'
249 ##########################################################################
250 # Check if net_retry_count can be accessed with and without @@ sign #
251 ##########################################################################
252
253 SET net_retry_count = 1;
254 SELECT @@net_retry_count;
255 --Error ER_UNKNOWN_TABLE
256 SELECT local.net_retry_count;
257 --Error ER_UNKNOWN_TABLE
258 SELECT session.net_retry_count;
259 --Error ER_BAD_FIELD_ERROR
260 SELECT net_retry_count = @@session.net_retry_count;
261
262
263 ####################################
264 # Restore initial value #
265 ####################################
266
267 SET @@global.net_retry_count = @start_global_value;
268 SELECT @@global.net_retry_count;
269 SET @@session.net_retry_count = @start_session_value;
270 SELECT @@session.net_retry_count;
271
272
273 ####################################################
274 # END OF net_retry_count TESTS #
275 ####################################################
276