Debian Codegraph @

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

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