Debian Codegraph @

mysql-test/suite/x/t/mysqlx_server_var.test

raw
1 ## XPLUGIN: This is test file for mysqlx plugin server variables testing.
2 ## Created: 2015-08-10 Lalit Choudhary
3 ##
4
5 --source include/xplugin_preamble.inc
6 --source include/xplugin_create_user.inc
7
8 --echo # System Variables Testing
9 #
10 # Variable: mysqlx_idle_worker_thread_timeout
11 # Default : 60000
12 # Scope : GLOBAL
13 # Dynamic : Yes
14
15 ## Valid cases
16 SET GLOBAL mysqlx_idle_worker_thread_timeout=7;
17 SET @@global.mysqlx_idle_worker_thread_timeout=7;
18 show variables like 'mysqlx_idle_worker_thread_timeout';
19 #Max valid value
20 SET @@global.mysqlx_idle_worker_thread_timeout=3600;
21 show variables like 'mysqlx_idle_worker_thread_timeout';
22
23 ## Invalid cases
24 --error ER_GLOBAL_VARIABLE
25 SET mysqlx_idle_worker_thread_timeout=7;
26 --error ER_GLOBAL_VARIABLE
27 SET @@local.mysqlx_idle_worker_thread_timeout=7;
28 --error ER_GLOBAL_VARIABLE
29 SET @@mysqlx_idle_worker_thread_timeout=7;
30 --error ER_GLOBAL_VARIABLE
31 SET @@session.mysqlx_idle_worker_thread_timeout=7;
32 --error ER_GLOBAL_VARIABLE
33 SET SESSION mysqlx_idle_worker_thread_timeout=7;
34 # Warning: Truncated incorrect mysqlx_idle_worker_thread_timeout value
35 SET @@global.mysqlx_idle_worker_thread_timeout=3601;
36
37 #--error ER_GLOBAL_VARIABLE
38 SET GLOBAL mysqlx_idle_worker_thread_timeout=0;
39 # Warning for negative values
40 SET GLOBAL mysqlx_idle_worker_thread_timeout=-1;
41 --error ER_WRONG_TYPE_FOR_VAR
42 SET GLOBAL mysqlx_idle_worker_thread_timeout='invaid%char';
43
44 show variables like 'mysqlx_idle_worker_thread_timeout';
45 SET GLOBAL mysqlx_idle_worker_thread_timeout=60;
46
47 # Variable: mysqlx_max_allowed_packet
48 # Default : 1048576
49 # Scope : GLOBAL
50 # Dynamic : Yes
51
52 ## Valid cases
53 SET GLOBAL mysqlx_max_allowed_packet=5000000;
54 SET @@global.mysqlx_max_allowed_packet=7000000;
55 show variables like 'mysqlx_max_allowed_packet';
56
57 ## Invalid cases
58 --error ER_GLOBAL_VARIABLE
59 SET mysqlx_max_allowed_packet=5000000;
60 --error ER_GLOBAL_VARIABLE
61 SET @@local.mysqlx_max_allowed_packet=5000000;
62 --error ER_GLOBAL_VARIABLE
63 SET @@mysqlx_max_allowed_packet=5000000;
64 --error ER_GLOBAL_VARIABLE
65 SET @@session.mysqlx_max_allowed_packet=5000000;
66 --error ER_GLOBAL_VARIABLE
67 SET SESSION mysqlx_max_allowed_packet=5000000;
68
69 SET @@global.mysqlx_max_allowed_packet=0;
70
71 # Setting negative value for mysqlx_max_allowed_packet
72 # is assinging 512 packet size automaticaly.
73 SET @@global.mysqlx_max_allowed_packet=-123;
74 --error ER_WRONG_TYPE_FOR_VAR
75 SET @@global.mysqlx_max_allowed_packet='crash#$%';
76
77 show variables like 'mysqlx_max_allowed_packet';
78 SET @@global.mysqlx_max_allowed_packet=1048576;
79
80 # Variable: mysqlx_max_connections
81 # Default : 100
82 # Scope : GLOBAL
83 # Dynamic : Yes
84
85 ## Valid cases
86 SET GLOBAL mysqlx_max_connections=150;
87 show variables like 'mysqlx_max_connections';
88
89 SET @@global.mysqlx_max_connections=500;
90 show variables like 'mysqlx_max_connections';
91
92 ## Invalid cases
93 --error ER_GLOBAL_VARIABLE
94 SET mysqlx_max_connections=150;
95 --error ER_GLOBAL_VARIABLE
96 SET @@local.mysqlx_max_connections=150;
97 --error ER_GLOBAL_VARIABLE
98 SET @@mysqlx_max_connections=150;
99 --error ER_GLOBAL_VARIABLE
100 SET @@session.mysqlx_max_connections=150;
101 --error ER_GLOBAL_VARIABLE
102 SET SESSION mysqlx_max_connections=150;
103
104 # Warning: Truncated incorrect mysqlx_max_connections value
105 SET GLOBAL mysqlx_max_connections=0;
106
107 # It will set value to 1
108 SET GLOBAL mysqlx_max_connections=-848;
109
110 --error ER_WRONG_TYPE_FOR_VAR
111 SET GLOBAL mysqlx_max_connections='%45*#in';
112
113 show variables like 'mysqlx_max_connections';
114 SET @@global.mysqlx_max_connections=151;
115
116 # Variable: mysqlx_min_worker_threads
117 # Default : 10
118 # Scope : GLOBAL
119 # Dynamic : Yes
120
121 ## Valid cases
122 #minimum number of worker threads the X plugin will use for handling client requests.
123 #The maximum is limited implicitly by Mysqlx_max_connections.
124 # Truncated incorrect mysqlx_min_worker_threads value: '150'
125 SET GLOBAL mysqlx_min_worker_threads=150;
126 SET @@global.mysqlx_min_worker_threads=15;
127 show variables like 'mysqlx_min_worker_threads';
128
129 ## Invalid cases
130 --error ER_GLOBAL_VARIABLE
131 SET mysqlx_min_worker_threads=15;
132 --error ER_GLOBAL_VARIABLE
133 SET @@local.mysqlx_min_worker_threads=15;
134 --error ER_GLOBAL_VARIABLE
135 SET @@mysqlx_min_worker_threads=15;
136 --error ER_GLOBAL_VARIABLE
137 SET @@session.mysqlx_min_worker_threads=15;
138 --error ER_GLOBAL_VARIABLE
139 SET SESSION mysqlx_min_worker_threads=15;
140
141 SET @@global.mysqlx_min_worker_threads=0;
142 SET @@global.mysqlx_min_worker_threads=-4324;
143
144 # It will set value to 100
145 SET GLOBAL mysqlx_min_worker_threads=+23766;
146 --error ER_WRONG_TYPE_FOR_VAR
147 SET GLOBAL mysqlx_min_worker_threads='USDSI75u';
148
149 show variables like 'mysqlx_min_worker_threads';
150 SET GLOBAL mysqlx_min_worker_threads=10;
151
152 # Variable: mysqlx_connect_timeout
153 # Default : 300000
154 # Scope : GLOBAL
155 # Dynamic : Yes
156
157 ## Valid cases
158 SET GLOBAL mysqlx_connect_timeout=20;
159
160 # IT will set value to 300000
161 SET @@global.mysqlx_connect_timeout=500;
162 show variables like 'mysqlx_connect_timeout';
163
164 ## Invalid cases
165 --error ER_GLOBAL_VARIABLE
166 SET mysqlx_connect_timeout=20;
167 --error ER_GLOBAL_VARIABLE
168 SET @@local.mysqlx_connect_timeout=20;
169 --error ER_GLOBAL_VARIABLE
170 SET @@mysqlx_connect_timeout=20;
171 --error ER_GLOBAL_VARIABLE
172 SET @@session.mysqlx_connect_timeout=20;
173 --error ER_GLOBAL_VARIABLE
174 SET SESSION mysqlx_connect_timeout=20;
175
176 # Truncated incorrect mysqlx_connect_timeout value: '0'
177 SET GLOBAL mysqlx_connect_timeout=0;
178
179 SET GLOBAL mysqlx_connect_timeout=1;
180
181 # It will set vaule to 1
182 SET GLOBAL mysqlx_connect_timeout=-4686234;
183 --error ER_WRONG_TYPE_FOR_VAR
184 SET GLOBAL mysqlx_connect_timeout='gduges7';
185
186 show variables like 'mysqlx_connect_timeout';
187 SET GLOBAL mysqlx_connect_timeout=300;
188
189 # Variable: mysqlx_wait_timeout
190 # Default : 28800
191 # Scope : SESSION
192 # Dynamic : Yes
193
194 ## Valid cases
195 SET GLOBAL mysqlx_wait_timeout=20;
196 SET @@global.mysqlx_wait_timeout=500;
197
198 SET mysqlx_wait_timeout=30;
199 SET @@local.mysqlx_wait_timeout=40;
200 SET @@mysqlx_wait_timeout=50;
201 SET @@session.mysqlx_wait_timeout=60;
202 SET SESSION mysqlx_wait_timeout=70;
203
204 #Max valid value
205 SET @@global.mysqlx_wait_timeout=2147483;
206 show variables like 'mysqlx_wait_timeout';
207
208 # Warning: truncated incorrect value. It will set value to 1
209 SET GLOBAL mysqlx_wait_timeout=0;
210
211 SET GLOBAL mysqlx_wait_timeout=1;
212
213 # Warning: truncated incorrect value. It will set value to 1
214 SET GLOBAL mysqlx_wait_timeout=-4686234;
215
216 --error ER_WRONG_TYPE_FOR_VAR
217 SET GLOBAL mysqlx_wait_timeout='gduges7';
218
219 show variables like 'mysqlx_wait_timeout';
220 SET GLOBAL mysqlx_wait_timeout=28800;
221 SET SESSION mysqlx_wait_timeout=28800;
222
223 # Variable: mysqlx_interactive_timeout
224 # Default : 28800
225 # Scope : GLOBAL
226 # Dynamic : Yes
227
228 ## Valid cases
229 SET GLOBAL mysqlx_interactive_timeout=20;
230 SET @@global.mysqlx_interactive_timeout=500;
231
232 --error ER_GLOBAL_VARIABLE
233 SET mysqlx_interactive_timeout=30;
234 --error ER_GLOBAL_VARIABLE
235 SET @@local.mysqlx_interactive_timeout=40;
236 --error ER_GLOBAL_VARIABLE
237 SET @@mysqlx_interactive_timeout=50;
238 --error ER_GLOBAL_VARIABLE
239 SET @@session.mysqlx_interactive_timeout=60;
240 --error ER_GLOBAL_VARIABLE
241 SET SESSION mysqlx_interactive_timeout=70;
242
243 #Max valid value
244 SET @@global.mysqlx_interactive_timeout=2147483;
245 show variables like 'mysqlx_interactive_timeout';
246
247 # Warning: truncated incorrect value. It will set value to 1
248 SET GLOBAL mysqlx_interactive_timeout=0;
249
250 SET GLOBAL mysqlx_interactive_timeout=1;
251
252 # Warning: truncated incorrect value. It will set value to 1
253 SET GLOBAL mysqlx_interactive_timeout=-4686234;
254
255 --error ER_WRONG_TYPE_FOR_VAR
256 SET GLOBAL mysqlx_interactive_timeout='gduges7';
257
258 show variables like 'mysqlx_interactive_timeout';
259 SET GLOBAL mysqlx_interactive_timeout=28800;
260
261 # Variable: mysqlx_read_timeout
262 # Default : 30
263 # Scope : SESSION
264 # Dynamic : Yes
265
266 ## Valid cases
267 SET GLOBAL mysqlx_read_timeout=20;
268 SET @@global.mysqlx_read_timeout=500;
269
270 SET mysqlx_read_timeout=30;
271 SET @@local.mysqlx_read_timeout=40;
272 SET @@mysqlx_read_timeout=50;
273 SET @@session.mysqlx_read_timeout=60;
274 SET SESSION mysqlx_read_timeout=70;
275
276 #Max valid value
277 SET @@global.mysqlx_read_timeout=2147483;
278 show variables like 'mysqlx_read_timeout';
279
280 # Warning: truncated incorrect value. It will set value to 1
281 SET GLOBAL mysqlx_read_timeout=0;
282
283 SET GLOBAL mysqlx_read_timeout=1;
284
285 # Warning: truncated incorrect value. It will set value to 1
286 SET GLOBAL mysqlx_read_timeout=-4686234;
287
288 --error ER_WRONG_TYPE_FOR_VAR
289 SET GLOBAL mysqlx_read_timeout='gduges7';
290
291 show variables like 'mysqlx_read_timeout';
292 SET GLOBAL mysqlx_read_timeout=30;
293 SET SESSION mysqlx_read_timeout=30;
294
295 # Variable: mysqlx_write_timeout
296 # Default : 60
297 # Scope : SESSION
298 # Dynamic : Yes
299
300 ## Valid cases
301 SET GLOBAL mysqlx_write_timeout=20;
302 SET @@global.mysqlx_write_timeout=500;
303
304 SET mysqlx_write_timeout=300;
305 SET @@local.mysqlx_write_timeout=400;
306 SET @@mysqlx_write_timeout=500;
307 SET @@session.mysqlx_write_timeout=600;
308 SET SESSION mysqlx_write_timeout=700;
309
310 #Max valid value
311 SET @@global.mysqlx_write_timeout=2147483;
312 show variables like 'mysqlx_write_timeout';
313
314 # Warning: truncated incorrect value. It will set value to 1
315 SET GLOBAL mysqlx_write_timeout=0;
316
317 SET GLOBAL mysqlx_write_timeout=1;
318
319 # Warning: truncated incorrect value. It will set value to 1
320 SET GLOBAL mysqlx_write_timeout=-4686234;
321
322 --error ER_WRONG_TYPE_FOR_VAR
323 SET GLOBAL mysqlx_write_timeout='gduges7';
324
325 show variables like 'mysqlx_write_timeout';
326 SET GLOBAL mysqlx_write_timeout=60;
327 SET SESSION mysqlx_write_timeout=60;
328
329 # Variable: mysqlx_port
330 # Default : 33060
331 # Scope : GLOBAL
332 # Read only variable
333 --error ER_INCORRECT_GLOBAL_LOCAL_VAR
334 SET GLOBAL mysqlx_port=33060;
335
336 --write_file $MYSQL_TMP_DIR/mysqlx-variables.xpl
337 -->sql
338 SET GLOBAL mysqlx_idle_worker_thread_timeout=7;
339 SET @@global.mysqlx_idle_worker_thread_timeout=7;
340
341 SET GLOBAL mysqlx_max_allowed_packet=5000000;
342 SET @@global.mysqlx_max_allowed_packet=7000000;
343
344 SET GLOBAL mysqlx_max_connections=150;
345 SET @@global.mysqlx_max_connections=500;
346
347 SET GLOBAL mysqlx_min_worker_threads=15;
348 SET @@global.mysqlx_min_worker_threads=15;
349
350 SET GLOBAL mysqlx_connect_timeout=20;
351 SET @@global.mysqlx_connect_timeout=500;
352 -->endsql
353 EOF
354
355 --exec $MYSQLXTEST -u x_root --password='' --file=$MYSQL_TMP_DIR/mysqlx-variables.xpl 2>&1
356
357 # Cleanup
358 SET GLOBAL mysqlx_idle_worker_thread_timeout= DEFAULT;
359 SET GLOBAL mysqlx_max_allowed_packet= DEFAULT;
360 SET GLOBAL mysqlx_max_connections= DEFAULT;
361 SET GLOBAL mysqlx_min_worker_threads= DEFAULT;
362 SET GLOBAL mysqlx_connect_timeout= DEFAULT;
363 --source ../include/xplugin_cleanup.inc