MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
net_retry_count_basic.inc
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 #
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 # 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 # START OF net_retry_count TESTS #
30 ###############################################################
31 
32 
33 #############################################################
34 # Save initial value #
35 #############################################################
36 
37 SET @start_global_value = @@global.net_retry_count;
38 SELECT @start_global_value;
39 SET @start_session_value = @@session.net_retry_count;
40 SELECT @start_session_value;
41 
42 
43 --echo '#--------------------FN_DYNVARS_111_01-------------------------#'
44 ###############################################################
45 # Display the DEFAULT value of net_retry_count #
46 ###############################################################
47 
48 SET @@global.net_retry_count = 100;
49 SET @@global.net_retry_count = DEFAULT;
50 SELECT @@global.net_retry_count;
51 
52 SET @@session.net_retry_count = 200;
53 SET @@session.net_retry_count = DEFAULT;
54 SELECT @@session.net_retry_count;
55 
56 
57 --echo '#--------------------FN_DYNVARS_111_02-------------------------#'
58 ###############################################################
59 # Check the DEFAULT value of net_retry_count #
60 ###############################################################
61 
62 SET @@global.net_retry_count = DEFAULT;
63 SELECT @@global.net_retry_count = 10;
64 
65 SET @@session.net_retry_count = DEFAULT;
66 SELECT @@session.net_retry_count = 10;
67 
68 
69 --echo '#--------------------FN_DYNVARS_111_03-------------------------#'
70 #########################################################################
71 # Change the value of net_retry_count to a valid value for GLOBAL Scope #
72 #########################################################################
73 
74 SET @@global.net_retry_count = 1;
75 SELECT @@global.net_retry_count;
76 SET @@global.net_retry_count = 2;
77 SELECT @@global.net_retry_count;
78 SET @@global.net_retry_count = 4294967295;
79 SELECT @@global.net_retry_count;
80 SET @@global.net_retry_count = 4294967294;
81 SELECT @@global.net_retry_count;
82 SET @@global.net_retry_count = 65536;
83 SELECT @@global.net_retry_count;
84 
85 --echo '#--------------------FN_DYNVARS_111_04-------------------------#'
86 ##########################################################################
87 # Change the value of net_retry_count to a valid value for SESSION Scope #
88 ##########################################################################
89 
90 SET @@session.net_retry_count = 1;
91 SELECT @@session.net_retry_count;
92 SET @@session.net_retry_count = 2;
93 SELECT @@session.net_retry_count;
94 SET @@session.net_retry_count = 65535;
95 SELECT @@session.net_retry_count;
96 SET @@session.net_retry_count = 4294967295;
97 SELECT @@session.net_retry_count;
98 SET @@session.net_retry_count = 4294967294;
99 SELECT @@session.net_retry_count;
100 
101 --echo '#------------------FN_DYNVARS_111_05-----------------------#'
102 ###########################################################
103 # Change the value of net_retry_count to an invalid value #
104 ###########################################################
105 
106 SET @@global.net_retry_count = 0;
107 SELECT @@global.net_retry_count;
108 SET @@global.net_retry_count = -1024;
109 SELECT @@global.net_retry_count;
110 SET @@global.net_retry_count = 4294967296;
111 SELECT @@global.net_retry_count;
112 SET @@global.net_retry_count = 429496729500;
113 SELECT @@global.net_retry_count;
114 --Error ER_WRONG_TYPE_FOR_VAR
115 SET @@global.net_retry_count = 65530.34;
116 SELECT @@global.net_retry_count;
117 --Error ER_WRONG_TYPE_FOR_VAR
118 SET @@global.net_retry_count = test;
119 SELECT @@global.net_retry_count;
120 
121 SET @@session.net_retry_count = 0;
122 SELECT @@session.net_retry_count;
123 SET @@session.net_retry_count = -2;
124 SELECT @@session.net_retry_count;
125 --Error ER_WRONG_TYPE_FOR_VAR
126 SET @@session.net_retry_count = 65530.34;
127 SET @@session.net_retry_count = 6555015425;
128 SELECT @@session.net_retry_count;
129 SET @@session.net_retry_count = 4294967296;
130 SELECT @@session.net_retry_count;
131 
132 --Error ER_WRONG_TYPE_FOR_VAR
133 SET @@session.net_retry_count = test;
134 SELECT @@session.net_retry_count;
135 
136 
137 --echo '#------------------FN_DYNVARS_111_06-----------------------#'
138 ####################################################################
139 # Check if the value in GLOBAL Table matches value in variable #
140 ####################################################################
141 
142 
143 SELECT @@global.net_retry_count = VARIABLE_VALUE
144 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
145 WHERE VARIABLE_NAME='net_retry_count';
146 
147 --echo '#------------------FN_DYNVARS_111_07-----------------------#'
148 ####################################################################
149 # Check if the value in SESSION Table matches value in variable #
150 ####################################################################
151 
152 SELECT @@session.net_retry_count = VARIABLE_VALUE
153 FROM INFORMATION_SCHEMA.SESSION_VARIABLES
154 WHERE VARIABLE_NAME='net_retry_count';
155 
156 
157 --echo '#------------------FN_DYNVARS_111_08-----------------------#'
158 ####################################################################
159 # Check if TRUE and FALSE values can be used on variable #
160 ####################################################################
161 
162 SET @@global.net_retry_count = TRUE;
163 SELECT @@global.net_retry_count;
164 SET @@global.net_retry_count = FALSE;
165 SELECT @@global.net_retry_count;
166 
167 
168 --echo '#---------------------FN_DYNVARS_111_09----------------------#'
169 #################################################################################
170 # Check if accessing variable with and without GLOBAL point to same variable #
171 #################################################################################
172 
173 SET @@global.net_retry_count = 10;
174 SELECT @@net_retry_count = @@global.net_retry_count;
175 
176 
177 --echo '#---------------------FN_DYNVARS_111_10----------------------#'
178 ########################################################################################################
179 # Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
180 ########################################################################################################
181 
182 SET @@net_retry_count = 100;
183 SELECT @@net_retry_count = @@local.net_retry_count;
184 SELECT @@local.net_retry_count = @@session.net_retry_count;
185 
186 
187 --echo '#---------------------FN_DYNVARS_111_11----------------------#'
188 ##########################################################################
189 # Check if net_retry_count can be accessed with and without @@ sign #
190 ##########################################################################
191 
192 SET net_retry_count = 1;
193 SELECT @@net_retry_count;
194 --Error ER_UNKNOWN_TABLE
195 SELECT local.net_retry_count;
196 --Error ER_UNKNOWN_TABLE
197 SELECT session.net_retry_count;
198 --Error ER_BAD_FIELD_ERROR
199 SELECT net_retry_count = @@session.net_retry_count;
200 
201 
202 ####################################
203 # Restore initial value #
204 ####################################
205 
206 SET @@global.net_retry_count = @start_global_value;
207 SELECT @@global.net_retry_count;
208 SET @@session.net_retry_count = @start_session_value;
209 SELECT @@session.net_retry_count;
210 
211 
212 ####################################################
213 # END OF net_retry_count TESTS #
214 ####################################################
215