File: test_mysql_system_variable_update.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (516 lines) | stat: -rw-r--r-- 22,918 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
--echo #
--echo # WL#12002: SET system variable values as a component service
--echo #

--source ../../service_sys_var_registration/include/have_component_test_sys_var_service.inc

call mtr.add_suppression("Setting session values for system variables only makes sense in a user session");
call mtr.add_suppression("duplicate variable name");

# max unsigned long long depends on environment
--source include/check_64bit_machine.inc
if ($have_64bit_machine) {
  --let $maxint = 18446744073709551615
}
if (!$have_64bit_machine) {
  --let $maxint = 4294967295
}

--disable_query_log
eval SET @ui_max = $maxint;
--enable_query_log

INSTALL COMPONENT "file://component_test_mysql_system_variable_set";
INSTALL COMPONENT "file://component_test_sys_var_service";

# remember original state
SET @orig_connection_memory_limit = @@GLOBAL.connection_memory_limit;
SET @orig_lc_messages = @@GLOBAL.lc_messages;

--echo # Ensure the value of super read only is off
SELECT @@global.super_read_only;

--echo # Try setting wrong variable name in the same thread. Should fail
--error ER_UNKNOWN_SYSTEM_VARIABLE
SELECT test_set_system_variable_string(0, NULL, "the_meaning_of_life", "42", "GLOBAL");

--echo # Try setting wrong variable name in a new sub-thread. Should fail
--error ER_UNKNOWN_SYSTEM_VARIABLE
SELECT test_set_system_variable_string(1, NULL, "the_meaning_of_life", "42", "GLOBAL");

--echo # Try setting wrong (empty) variable name in the same thread. Should fail with NULL
SELECT test_set_system_variable_string(0, NULL, "", "42", "GLOBAL");

--echo # Try setting wrong value to super_read_only, Should fail
--error ER_WRONG_VALUE_FOR_VAR
SELECT test_set_system_variable_string(0, NULL, "super_read_only", "gizmo", "GLOBAL");

--echo # Ensure the value of super read only is still off
SELECT @@global.super_read_only;

--echo # Try setting super_read_only on using the same thread. Should succeed
SELECT test_set_system_variable_string(0, NULL, "super_read_only", "on", "GLOBAL");

--echo # Ensure the value of super read only is on
SELECT @@global.super_read_only;

--echo # Try setting super_read_only to off using a new sub-thread. Should succeed
SELECT test_set_system_variable_string(1, NULL, "super_read_only", "off", "GLOBAL");

--echo # Ensure the value of super read only is off
SELECT @@global.super_read_only;

--echo # Check that the variable is not yet persisted:
SELECT * FROM performance_schema.persisted_variables WHERE VARIABLE_NAME='super_read_only';

--echo # Try setting PERSIST super_read_only. Should succeed
SELECT test_set_system_variable_string(0, NULL, "super_read_only", "off", "PERSIST");

--echo # Check that the variable is now persisted:
SELECT VARIABLE_VALUE,@@global.super_read_only
  FROM performance_schema.persisted_variables WHERE VARIABLE_NAME='super_read_only';

--echo # reset persisted value
RESET PERSIST super_read_only;

--echo # Try setting PERSIST_ONLY super_read_only. Should succeed
SELECT test_set_system_variable_string(0, NULL, "super_read_only", "on", "PERSIST_ONLY");

--echo # Check that the variable is now persisted only but not changed:
SELECT VARIABLE_VALUE,@@global.super_read_only
  FROM performance_schema.persisted_variables WHERE VARIABLE_NAME='super_read_only';

--echo # reset persisted value
RESET PERSIST super_read_only;

--echo # Show initial value of str_sys_var component system variable
SELECT @@test_component.str_sys_var;

--echo # Try setting str_sys_var from test component to some value. Should succeed
SELECT test_set_system_variable_string(0, "test_component", "str_sys_var", "Sample text", "GLOBAL");

--echo # Ensure the value of str_sys_var component system variable has changed
SELECT @@test_component.str_sys_var;

--echo # Show initial value of super read only before next test
SELECT @@global.super_read_only;

--echo # Bug#34072134: mysql_system_variable_update_string::set does not allow NULL for variable_type
--echo # Try setting super_read_only on using NULL type (defaults to GLOBAL). Should succeed
SELECT test_set_system_variable_string(0, NULL, "super_read_only", "on", NULL);

--echo # Ensure the value of super read only is on
SELECT @@global.super_read_only;

--echo # Bug#34072155: Improve mysql_system_variable_update_string::set to add error information
--echo # Try using SESSION type with sub-thread, Should fail with NULL
SELECT test_set_system_variable_string(1, NULL, "super_read_only", "off", "SESSION");

--echo # Ensure the value of super read only is still on
SELECT @@global.super_read_only;

--echo # Bug#34302316: Sig11 when passing THD parameter value greater than 0 via service methods
--echo # Try setting PERSIST_ONLY super_read_only with sub-thread. Should succeed
SELECT test_set_system_variable_string(1, NULL, "super_read_only", "off", "PERSIST_ONLY");

--echo # Check that the variable is now persisted only but not changed:
SELECT VARIABLE_VALUE,@@global.super_read_only
  FROM performance_schema.persisted_variables WHERE VARIABLE_NAME='super_read_only';

--echo # Try setting PERSIST super_read_only with sub-thread. Should succeed
SELECT test_set_system_variable_string(1, NULL, "super_read_only", "off", "PERSIST");

--echo # reset persisted value
RESET PERSIST super_read_only;

--echo #
--echo # WL#15168: Component service to set integer values to sysvars
--echo #

--echo
--echo # 1. Testing mysql_service_mysql_system_variable_update_integer::set_signed method
--echo

--echo # Try setting wrong variable name in the same thread. Should fail
--error ER_UNKNOWN_SYSTEM_VARIABLE
SELECT test_set_system_variable_signed_integer(0, NULL, "the_meaning_of_life", 42, "GLOBAL");

--echo # Try setting wrong variable name in a new sub-thread. Should fail
--error ER_UNKNOWN_SYSTEM_VARIABLE
SELECT test_set_system_variable_signed_integer(1, NULL, "the_meaning_of_life", 42, "GLOBAL");

--echo # Try setting wrong (empty) variable name in the same thread. Should fail with NULL
SELECT test_set_system_variable_signed_integer(0, NULL, "", 42, "GLOBAL");

--echo # Set initial value of connection_memory_limit before the test
SET @@global.connection_memory_limit = 16777216;

--echo # Try setting connection_memory_limit to valid value. Should succeed
SELECT test_set_system_variable_signed_integer(0, NULL, "connection_memory_limit", 33333333, "GLOBAL");

--echo # Ensure the value of connection_memory_limit has changed
SELECT @@global.connection_memory_limit;

--echo # Try setting connection_memory_limit to max value. Should succeed but value truncated (differs on 32 vs 64-bit)
--disable_warnings
SELECT test_set_system_variable_signed_integer(0, NULL, "connection_memory_limit", @ui_max, "GLOBAL");
--enable_warnings

--echo # Try setting admin_port (read-only variable) to valid value. Should fail
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT test_set_system_variable_signed_integer(0, NULL, "admin_port", 10000, "GLOBAL");

--echo # Show initial value of block_encryption_mode before the test
SELECT @@global.block_encryption_mode;

--echo # Try setting block_encryption_mode (string with limited set of accepted values) to integer. Should fail
--error ER_WRONG_VALUE_FOR_VAR
SELECT test_set_system_variable_signed_integer(0, NULL, "block_encryption_mode", 10000, "GLOBAL");

--echo # Ensure the value of block_encryption_mode has not changed
SELECT @@global.block_encryption_mode;

--echo # Try setting string variable to an integer. Should fail
--error ER_WRONG_TYPE_FOR_VAR
SELECT test_set_system_variable_signed_integer(0, NULL, "init_connect", 42, "GLOBAL");

--echo # Try setting super_read_only (boolean) to integer. Should fail
--error ER_WRONG_VALUE_FOR_VAR
SELECT test_set_system_variable_signed_integer(0, NULL, "super_read_only", 10000, "GLOBAL");

--echo # Ensure the value of super_read_only has not changed
SELECT @@global.super_read_only;

--echo # Try setting super_read_only (boolean) to value that can be converted to boolean. Should suceed
SELECT test_set_system_variable_signed_integer(0, NULL, "super_read_only", 0, "GLOBAL");

--echo # Ensure the value of super_read_only has changed
SELECT @@global.super_read_only;

--echo # Check that the variable connection_memory_limit is not yet persisted:
SELECT * FROM performance_schema.persisted_variables WHERE VARIABLE_NAME='connection_memory_limit';

--echo # Try setting PERSIST connection_memory_limit. Should succeed
SELECT test_set_system_variable_signed_integer(0, NULL, "connection_memory_limit", 44444444, "PERSIST");

--echo # Check that the variable is now persisted:
SELECT VARIABLE_VALUE,@@global.connection_memory_limit
  FROM performance_schema.persisted_variables WHERE VARIABLE_NAME='connection_memory_limit';

--echo # reset persisted value
RESET PERSIST connection_memory_limit;

--echo # Try setting PERSIST_ONLY connection_memory_limit. Should succeed
SELECT test_set_system_variable_signed_integer(0, NULL, "connection_memory_limit", 55555555, "PERSIST_ONLY");

--echo # Check that the variable is now persisted only but not changed:
SELECT VARIABLE_VALUE,@@global.connection_memory_limit
  FROM performance_schema.persisted_variables WHERE VARIABLE_NAME='connection_memory_limit';

--echo # reset persisted value
RESET PERSIST connection_memory_limit;

--echo # Try setting connection_memory_limit with NULL type (defaults to GLOBAL). Should succeed
SELECT test_set_system_variable_signed_integer(0, NULL, "connection_memory_limit", 77777777, NULL);

--echo # Ensure the value has changed
SELECT @@global.connection_memory_limit;

--echo # Set initial session value before the test
SET @@session.connection_memory_limit=55555555;

--echo # Try using SESSION type with sub-thread, Should fail with NULL
SELECT test_set_system_variable_signed_integer(1, NULL, "connection_memory_limit", 88888888, "SESSION");

--echo # Ensure the session value has not changed
SELECT @@session.connection_memory_limit;

--echo # Try using SESSION type with current thread, Should succeed
SELECT test_set_system_variable_signed_integer(0, NULL, "connection_memory_limit", 99999999, "SESSION");

--echo # Ensure the session value has changed
SELECT @@session.connection_memory_limit;

--echo # Show initial value of int_sys_var component system variable
SELECT @@test_component.int_sys_var;

--echo # Try setting int_sys_var from test component to some value. Should succeed
SELECT test_set_system_variable_signed_integer(0, "test_component", "int_sys_var", 1024, "GLOBAL");

--echo # Ensure the value of int_sys_var component system variable has changed
SELECT @@test_component.int_sys_var;

--echo # Bug#34294012: Sig11 when passing THD parameter value greater than 0 via service methods
--echo # Try setting PERSIST_ONLY connection_memory_limit with sub-thread. Should succeed
SELECT test_set_system_variable_signed_integer(1, NULL, "connection_memory_limit", 5000000, "PERSIST_ONLY");

--echo # Check that the variable is now persisted only but not changed:
SELECT VARIABLE_VALUE,@@global.connection_memory_limit
  FROM performance_schema.persisted_variables WHERE VARIABLE_NAME='connection_memory_limit';

--echo # Try setting PERSIST connection_memory_limit with sub-thread. Should succeed
SELECT test_set_system_variable_signed_integer(1, NULL, "connection_memory_limit", 5000000, "PERSIST");

--echo # reset persisted value
RESET PERSIST connection_memory_limit;

--echo
--echo # 2. Testing mysql_service_mysql_system_variable_update_integer::set_unsigned method
--echo

--echo # Try setting wrong variable name in the same thread. Should fail
--error ER_UNKNOWN_SYSTEM_VARIABLE
SELECT test_set_system_variable_unsigned_integer(0, NULL, "the_meaning_of_life", 42, "GLOBAL");

--echo # Try setting wrong variable name in a new sub-thread. Should fail
--error ER_UNKNOWN_SYSTEM_VARIABLE
SELECT test_set_system_variable_unsigned_integer(1, NULL, "the_meaning_of_life", 42, "GLOBAL");

--echo # Try setting wrong (empty) variable name in the same thread. Should fail with NULL
SELECT test_set_system_variable_unsigned_integer(0, NULL, "", 42, "GLOBAL");

--echo # Show initial value before the test
SELECT @@global.connection_memory_limit;

--echo # Try setting connection_memory_limit to max value. Should succeed
SELECT test_set_system_variable_unsigned_integer(0, NULL, "connection_memory_limit", @ui_max, "GLOBAL");

--echo # Ensure the value of connection_memory_limit has changed
SELECT @@global.connection_memory_limit = @ui_max;

--echo # Try setting connection_memory_limit to other valid value. Should succeed
SELECT test_set_system_variable_unsigned_integer(0, NULL, "connection_memory_limit", 33333333, "GLOBAL");

--echo # Ensure the value of connection_memory_limit has changed
SELECT @@global.connection_memory_limit;

--echo # Try setting connection_memory_limit to negative value. Should succeed (but value truncated)
--disable_warnings
SELECT test_set_system_variable_unsigned_integer(0, NULL, "connection_memory_limit", -100000, "GLOBAL");
--enable_warnings

--echo # Try setting admin_port (read-only variable) to valid value. Should fail
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT test_set_system_variable_unsigned_integer(0, NULL, "admin_port", 10000, "GLOBAL");

--echo # Show initial value of block_encryption_mode before the test
SELECT @@global.block_encryption_mode;

--echo # Try setting block_encryption_mode (string with limited set of accepted values) to integer. Should fail
--error ER_WRONG_VALUE_FOR_VAR
SELECT test_set_system_variable_unsigned_integer(0, NULL, "block_encryption_mode", 10000, "GLOBAL");

--echo # Ensure the value of block_encryption_mode has not changed
SELECT @@global.block_encryption_mode;

--echo # Try setting string variable to an integer. Should fail
--error ER_WRONG_TYPE_FOR_VAR
SELECT test_set_system_variable_unsigned_integer(0, NULL, "init_connect", 42, "GLOBAL");

--echo # Try setting super_read_only (boolean) to integer. Should fail
--error ER_WRONG_VALUE_FOR_VAR
SELECT test_set_system_variable_unsigned_integer(0, NULL, "super_read_only", 10000, "GLOBAL");

--echo # Ensure the value of super_read_only has not changed
SELECT @@global.super_read_only;

--echo # Try setting super_read_only (boolean) to value that can be converted to boolean. Should suceed
SELECT test_set_system_variable_unsigned_integer(0, NULL, "super_read_only", 1, "GLOBAL");

--echo # Ensure the value of super_read_only has changed
SELECT @@global.super_read_only;

--echo # Check that the variable connection_memory_limit is not yet persisted:
SELECT * FROM performance_schema.persisted_variables WHERE VARIABLE_NAME='connection_memory_limit';

--echo # Try setting PERSIST connection_memory_limit. Should succeed
SELECT test_set_system_variable_unsigned_integer(0, NULL, "connection_memory_limit", 44444444, "PERSIST");

--echo # Check that the variable is now persisted:
SELECT VARIABLE_VALUE,@@global.connection_memory_limit
  FROM performance_schema.persisted_variables WHERE VARIABLE_NAME='connection_memory_limit';

--echo # reset persisted value
RESET PERSIST connection_memory_limit;

--echo # Try setting PERSIST_ONLY connection_memory_limit. Should succeed
SELECT test_set_system_variable_unsigned_integer(0, NULL, "connection_memory_limit", 55555555, "PERSIST_ONLY");

--echo # Check that the variable is now persisted only but not changed:
SELECT VARIABLE_VALUE,@@global.connection_memory_limit
  FROM performance_schema.persisted_variables WHERE VARIABLE_NAME='connection_memory_limit';

--echo # reset persisted value
RESET PERSIST connection_memory_limit;

--echo # Try setting connection_memory_limit with NULL type (defaults to GLOBAL). Should succeed
SELECT test_set_system_variable_unsigned_integer(0, NULL, "connection_memory_limit", 77777777, NULL);

--echo # Ensure the value has changed
SELECT @@global.connection_memory_limit;

--echo # Set initial session value before the test
SET @@session.connection_memory_limit=55555555;

--echo # Try using SESSION type with sub-thread, Should fail with NULL
SELECT test_set_system_variable_unsigned_integer(1, NULL, "connection_memory_limit", 88888888, "SESSION");

--echo # Ensure the session value has not changed
SELECT @@session.connection_memory_limit;

--echo # Try using SESSION type with current thread, Should succeed
SELECT test_set_system_variable_unsigned_integer(0, NULL, "connection_memory_limit", 99999999, "SESSION");

--echo # Ensure the session value has changed
SELECT @@session.connection_memory_limit;

--echo # Show initial value of uint_sys_var component system variable
SELECT @@test_component.uint_sys_var;

--echo # Try setting uint_sys_var from test component to some value. Should succeed
SELECT test_set_system_variable_unsigned_integer(0, "test_component", "uint_sys_var", 100000, "GLOBAL");

--echo # Ensure the value of uint_sys_var component system variable has changed
SELECT @@test_component.uint_sys_var;

--echo # Bug#34294012: Sig11 when passing THD parameter value greater than 0 via service methods
--echo # Try setting PERSIST_ONLY connection_memory_limit with sub-thread. Should succeed
SELECT test_set_system_variable_unsigned_integer(1, NULL, "connection_memory_limit", 6000000, "PERSIST_ONLY");

--echo # Check that the variable is now persisted only but not changed:
SELECT VARIABLE_VALUE,@@global.connection_memory_limit
  FROM performance_schema.persisted_variables WHERE VARIABLE_NAME='connection_memory_limit';

--echo # Try setting PERSIST connection_memory_limit with sub-thread. Should succeed
SELECT test_set_system_variable_unsigned_integer(1, NULL, "connection_memory_limit", 6000000, "PERSIST");

--echo # reset persisted value
RESET PERSIST connection_memory_limit;

--echo
--echo # 3. Testing mysql_service_mysql_system_variable_update_default::set method
--echo

--echo # Try setting wrong variable name in the same thread. Should fail
--error ER_UNKNOWN_SYSTEM_VARIABLE
SELECT test_set_system_variable_default(0, NULL, "the_meaning_of_life", "GLOBAL");

--echo # Try setting wrong variable name in a new sub-thread. Should fail
--error ER_UNKNOWN_SYSTEM_VARIABLE
SELECT test_set_system_variable_default(1, NULL, "the_meaning_of_life", "GLOBAL");

--echo # Try setting wrong (empty) variable name in the same thread. Should fail with NULL
SELECT test_set_system_variable_default(0, NULL, "", "GLOBAL");

--echo # Try setting admin_port (read-only variable) to default value. Should fail
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT test_set_system_variable_default(0, NULL, "admin_port", "GLOBAL");

--echo # Try setting connection_memory_limit (unsigned) to default value. Should succeed
SELECT test_set_system_variable_default(0, NULL, "connection_memory_limit", "GLOBAL");

--echo # Ensure the value of connection_memory_limit has changed
SELECT @@global.connection_memory_limit=@ui_max;

--echo # Change value to non-default
SET @@global.lc_messages = "en_GB";

--echo # Try setting lc_messages (string) to default value. Should succeed
SELECT test_set_system_variable_default(0, NULL, "lc_messages", "GLOBAL");

--echo # Ensure the value of lc_messages has changed to default
SELECT @@global.lc_messages;

--echo # Try setting super_read_only (boolean) to default. Should succeed
SELECT test_set_system_variable_default(0, NULL, "super_read_only", "GLOBAL");

--echo # Ensure the value of super_read_only has changed to OFF
SELECT @@global.super_read_only;

--echo # Set the session variable to non-default value
SET @@session.connection_memory_limit=9999999;

--echo # Try using SESSION type with sub-thread, Should fail with NULL
SELECT test_set_system_variable_default(1, NULL, "connection_memory_limit", "SESSION");

--echo # Ensure the value has not changed
SELECT @@session.connection_memory_limit;

--echo # Try using SESSION type with current thread, Should succeed
SELECT test_set_system_variable_default(0, NULL, "connection_memory_limit", "SESSION");

--echo # Ensure the session value has changed
SELECT @@session.connection_memory_limit=@ui_max;

--echo # Set the variable to non-default value
SET @@global.connection_memory_limit=16777216;

--echo # Check that the variable connection_memory_limit is not yet persisted:
SELECT * FROM performance_schema.persisted_variables WHERE VARIABLE_NAME='connection_memory_limit';

--echo # Try setting PERSIST connection_memory_limit. Should succeed
SELECT test_set_system_variable_default(0, NULL, "connection_memory_limit", "PERSIST");

--echo # Check that the variable is now persisted:
SELECT VARIABLE_VALUE=@ui_max,@@global.connection_memory_limit=@ui_max
  FROM performance_schema.persisted_variables WHERE VARIABLE_NAME='connection_memory_limit';

--echo # reset persisted value
RESET PERSIST connection_memory_limit;

--echo # Set the variable to non-default value
SET @@global.connection_memory_limit=16777216;

--echo # Try setting PERSIST_ONLY connection_memory_limit. Should succeed
SELECT test_set_system_variable_default(0, NULL, "connection_memory_limit", "PERSIST_ONLY");

--echo # Check that the variable is now persisted only but not changed:
SELECT VARIABLE_VALUE=@ui_max,@@global.connection_memory_limit
  FROM performance_schema.persisted_variables WHERE VARIABLE_NAME='connection_memory_limit';

--echo # reset persisted value
RESET PERSIST connection_memory_limit;

--echo # Show initial value of uint_sys_var component system variable
SELECT @@test_component.uint_sys_var;

--echo # Try setting uint_sys_var from test component to default value. Should succeed
SELECT test_set_system_variable_default(0, "test_component", "uint_sys_var", "GLOBAL");

--echo # Ensure the value of uint_sys_var component system variable has changed
SELECT @@test_component.uint_sys_var;

--echo # Bug#34294012: Sig11 when passing THD parameter value greater than 0 via service methods
--echo # Set the variable to non-default value
SET @@global.connection_memory_limit=16777216;

--echo # Try setting PERSIST_ONLY connection_memory_limit with sub-thread. Should succeed
SELECT test_set_system_variable_default(1, NULL, "connection_memory_limit", "PERSIST_ONLY");

--echo # Check that the variable is now persisted only but not changed:
SELECT VARIABLE_VALUE=@ui_max,@@global.connection_memory_limit
  FROM performance_schema.persisted_variables WHERE VARIABLE_NAME='connection_memory_limit';

--echo # Try setting PERSIST connection_memory_limit with sub-thread. Should succeed
SELECT test_set_system_variable_default(1, NULL, "connection_memory_limit", "PERSIST");

--echo # reset persisted value
RESET PERSIST connection_memory_limit;

--echo # Cleanup
SET @@GLOBAL.connection_memory_limit = @orig_connection_memory_limit;
SET @@GLOBAL.lc_messages = @orig_lc_messages;
SET GLOBAL read_only = DEFAULT;
RESET PERSIST;
UNINSTALL COMPONENT "file://component_test_mysql_system_variable_set";
UNINSTALL COMPONENT "file://component_test_sys_var_service";

# Remove component log file
let $MYSQLD_DATADIR= `select @@datadir`;
remove_file $MYSQLD_DATADIR/test_component_sys_var_service.log;

# Remove persist file
remove_file $MYSQLD_DATADIR/mysqld-auto.cnf;

--echo # End of 8.0 tests