File: persisted_variables.result

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 (491 lines) | stat: -rw-r--r-- 15,456 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
#
# WL#8688: Support ability to persist SET GLOBAL settings
#
# Syntax check for PERSIST option
SET PERSIST autocommit=0;
SET @@persist.max_execution_time=60000;
SET PERSIST max_user_connections=10, PERSIST max_allowed_packet=8388608;
SET @@persist.max_user_connections=10, PERSIST max_allowed_packet=8388608;
SET @@persist.max_user_connections=10, @@persist.max_allowed_packet=8388608;
SET PERSIST max_user_connections=10, @@persist.max_allowed_packet=8388608;
# Syntax check for PERSIST/GLOBAL combination
SET PERSIST autocommit=0, GLOBAL max_user_connections=10;
SET @@persist.autocommit=0, @@global.max_user_connections=10;
SET GLOBAL autocommit=0, PERSIST max_user_connections=10;
SET @@global.autocommit=0, @@persist.max_user_connections=10;
# Syntax check for PERSIST/SESSION combination
SET PERSIST autocommit=0, SESSION auto_increment_offset=10;
SET @@persist.autocommit=0, @@session.auto_increment_offset=10;
SET SESSION auto_increment_offset=20, PERSIST max_user_connections=10;
SET @@session.auto_increment_offset=20, @@persist.max_user_connections=10;
SET PERSIST autocommit=0, auto_increment_offset=10;
SET autocommit=0, PERSIST auto_increment_offset=10;
# Syntax check for PERSIST/SESSION/GLOBAL combination
SET PERSIST autocommit=0, SESSION auto_increment_offset=10, GLOBAL max_error_count= 128;
SET SESSION autocommit=0, GLOBAL auto_increment_offset=10, PERSIST max_allowed_packet=8388608;
SET GLOBAL autocommit=0, PERSIST auto_increment_offset=10, SESSION max_error_count= 128;
SET @@persist.autocommit=0, @@session.auto_increment_offset=10, @@global.max_allowed_packet=8388608;
SET @@session.autocommit=0, @@global.auto_increment_offset=10, @@persist.max_allowed_packet=8388608;
SET @@global.autocommit=0, @@persist.auto_increment_offset=10, @@session.max_error_count= 128;
# Restart server
# default values
SELECT @@global.max_connections;
@@global.max_connections
151
SET PERSIST max_connections=33;
# Restart server and check for values
# after restart
SELECT @@global.max_connections;
@@global.max_connections
33
# default values
SELECT @@global.sort_buffer_size;
@@global.sort_buffer_size
262144
SELECT @@global.max_heap_table_size;
@@global.max_heap_table_size
16777216
SELECT @@global.replica_net_timeout;
@@global.replica_net_timeout
60
# persist few more variables
SET PERSIST sort_buffer_size=256000;
SET PERSIST max_heap_table_size=999424, replica_net_timeout=124;
SET PERSIST long_query_time= 8.3452;
SET PERSIST sql_require_primary_key= true;
SET PERSIST default_table_encryption= true;
SET PERSIST table_encryption_privilege_check= true;
# Restart server
# after restart
SELECT @@global.max_connections;
@@global.max_connections
33
SELECT @@global.sort_buffer_size;
@@global.sort_buffer_size
256000
SELECT @@global.max_heap_table_size;
@@global.max_heap_table_size
999424
SELECT @@global.replica_net_timeout;
@@global.replica_net_timeout
124
SELECT @@global.long_query_time;
@@global.long_query_time
8.345200
SELECT @@global.sql_require_primary_key;
@@global.sql_require_primary_key
1
SELECT @@global.default_table_encryption;
@@global.default_table_encryption
1
SELECT @@global.table_encryption_privilege_check;
@@global.table_encryption_privilege_check
1
# modify existing persisted variables
SET PERSIST sort_buffer_size=156000,max_connections= 52;
SET PERSIST max_heap_table_size=887808, replica_net_timeout=160;
SET PERSIST long_query_time= 7.8102;
SET PERSIST sql_require_primary_key= false;
SET PERSIST default_table_encryption= false;
SET PERSIST table_encryption_privilege_check= false;
# Restart server
# after restart
SELECT @@global.max_connections;
@@global.max_connections
52
SELECT @@global.sort_buffer_size;
@@global.sort_buffer_size
156000
SELECT @@global.max_heap_table_size;
@@global.max_heap_table_size
887808
SELECT @@global.replica_net_timeout;
@@global.replica_net_timeout
160
SELECT @@global.long_query_time;
@@global.long_query_time
7.810200
SELECT @@global.sql_require_primary_key;
@@global.sql_require_primary_key
0
SELECT @@global.default_table_encryption;
@@global.default_table_encryption
0
SELECT @@global.table_encryption_privilege_check;
@@global.table_encryption_privilege_check
0
SELECT @@global.max_user_connections;
@@global.max_user_connections
0
SELECT @@global.max_execution_time;
@@global.max_execution_time
0
# modify existing persisted variables and add new
SET PERSIST sort_buffer_size=256000;
SET PERSIST max_heap_table_size=999424, replica_net_timeout=124;
SET PERSIST long_query_time= 2.999999;
SET PERSIST sql_require_primary_key= true;
SET PERSIST default_table_encryption= true;
SET PERSIST table_encryption_privilege_check= true;
SET @@persist.max_execution_time=44000, @@persist.max_user_connections=30;
# Restart server
# after restart
SELECT @@global.sort_buffer_size;
@@global.sort_buffer_size
256000
SELECT @@global.max_heap_table_size;
@@global.max_heap_table_size
999424
SELECT @@global.replica_net_timeout;
@@global.replica_net_timeout
124
SELECT @@global.max_user_connections;
@@global.max_user_connections
30
SELECT @@global.max_execution_time;
@@global.max_execution_time
44000
SELECT @@global.long_query_time;
@@global.long_query_time
2.999999
SELECT @@global.sql_require_primary_key;
@@global.sql_require_primary_key
1
SELECT @@global.default_table_encryption;
@@global.default_table_encryption
1
SELECT @@global.table_encryption_privilege_check;
@@global.table_encryption_privilege_check
1
# reset persisted variables
RESET PERSIST sort_buffer_size;
RESET PERSIST max_heap_table_size;
RESET PERSIST max_execution_time;
RESET PERSIST max_user_connections;
RESET PERSIST sql_require_primary_key;
RESET PERSIST default_table_encryption;
RESET PERSIST table_encryption_privilege_check;
# Restart server
# after restart
SELECT @@global.sort_buffer_size;
@@global.sort_buffer_size
262144
SELECT @@global.max_heap_table_size;
@@global.max_heap_table_size
16777216
SELECT @@global.replica_net_timeout;
@@global.replica_net_timeout
124
SELECT @@global.max_user_connections;
@@global.max_user_connections
0
SELECT @@global.max_execution_time;
@@global.max_execution_time
0
SELECT @@global.max_connections;
@@global.max_connections
52
SELECT @@global.server_id;
@@global.server_id
1
SELECT @@global.general_log;
@@global.general_log
1
SELECT @@global.concurrent_insert;
@@global.concurrent_insert
AUTO
SELECT @@global.sql_require_primary_key;
@@global.sql_require_primary_key
0
SELECT @@global.default_table_encryption;
@@global.default_table_encryption
0
SELECT @@global.table_encryption_privilege_check;
@@global.table_encryption_privilege_check
0
# reset persisted variables and add new
RESET PERSIST replica_net_timeout;
SET PERSIST server_id=47, @@persist.general_log=0;
SET PERSIST concurrent_insert=NEVER;
RESET PERSIST max_connections;
# Restart server
# after restart
SELECT @@global.sort_buffer_size;
@@global.sort_buffer_size
262144
SELECT @@global.max_heap_table_size;
@@global.max_heap_table_size
16777216
SELECT @@global.replica_net_timeout;
@@global.replica_net_timeout
60
SELECT @@global.max_user_connections;
@@global.max_user_connections
0
SELECT @@global.max_execution_time;
@@global.max_execution_time
0
SELECT @@global.max_connections;
@@global.max_connections
151
SELECT @@global.server_id;
@@global.server_id
47
SELECT @@global.general_log;
@@global.general_log
0
SELECT @@global.concurrent_insert;
@@global.concurrent_insert
NEVER
# check precedence with command line option
SELECT @@global.max_connections;
@@global.max_connections
151
SELECT @@global.server_id;
@@global.server_id
47
SET PERSIST max_connections=88;
SET PERSIST server_id=9;
SET PERSIST session_track_system_variables='autocommit';
# Restart server with command line option
# after restart must be 88,9, autocommit
SELECT @@global.max_connections;
@@global.max_connections
88
SELECT @@global.server_id;
@@global.server_id
9
SELECT @@global.session_track_system_variables;
@@global.session_track_system_variables
autocommit

SELECT * FROM performance_schema.persisted_variables ORDER BY 1;
VARIABLE_NAME	VARIABLE_VALUE
concurrent_insert	NEVER
general_log	OFF
long_query_time	2.999999
max_connections	88
server_id	9
session_track_system_variables	autocommit
RESET PERSIST server_id;
RESET PERSIST general_log;
SET PERSIST max_connections=77;
SET PERSIST session_track_system_variables='max_connections';
SELECT * FROM performance_schema.persisted_variables ORDER BY 1;
VARIABLE_NAME	VARIABLE_VALUE
concurrent_insert	NEVER
long_query_time	2.999999
max_connections	77
session_track_system_variables	max_connections

SET PERSIST max_connections=99;
RESET PERSIST session_track_system_variables;
SET PERSIST concurrent_insert=ALWAYS;
SELECT * FROM performance_schema.persisted_variables ORDER BY 1;
VARIABLE_NAME	VARIABLE_VALUE
concurrent_insert	ALWAYS
long_query_time	2.999999
max_connections	99

RESET PERSIST max_connections;
SET PERSIST concurrent_insert=AUTO;
SELECT * FROM performance_schema.persisted_variables ORDER BY 1;
VARIABLE_NAME	VARIABLE_VALUE
concurrent_insert	AUTO
long_query_time	2.999999

# negative tests persist session only variables
SET @@persist.sql_log_bin=0;
ERROR HY000: Variable 'sql_log_bin' is a SESSION variable and can't be used with SET GLOBAL
# Test persisted-globals-load
SELECT @@global.persisted_globals_load;
@@global.persisted_globals_load
1
# New read-only variable persisted_globals_load.
SET PERSIST persisted_globals_load=0;
ERROR HY000: Variable 'persisted_globals_load' is a read only variable
SET GLOBAL  persisted_globals_load=ON;
ERROR HY000: Variable 'persisted_globals_load' is a read only variable
SET SESSION persisted_globals_load=1;
ERROR HY000: Variable 'persisted_globals_load' is a read only variable
SET GLOBAL persisted_globals_load= 'abc';
ERROR HY000: Variable 'persisted_globals_load' is a read only variable
SET GLOBAL persisted_globals_load= -1;
ERROR HY000: Variable 'persisted_globals_load' is a read only variable
# Test persisted-globals-load functionality
SET PERSIST sort_buffer_size=256000;
SET PERSIST max_heap_table_size=999424, replica_net_timeout=124;
# Restart server
# values must be read from persited config file
SELECT @@global.sort_buffer_size;
@@global.sort_buffer_size
256000
SELECT @@global.max_heap_table_size;
@@global.max_heap_table_size
999424
SELECT @@global.replica_net_timeout;
@@global.replica_net_timeout
124
SELECT @@global.foreign_key_checks;
@@global.foreign_key_checks
1
SET PERSIST foreign_key_checks=0;
SET PERSIST flush_time=2;
# Restart server with persisted-globals-load=0
# should have default values
SELECT @@global.sort_buffer_size;
@@global.sort_buffer_size
262144
SELECT @@global.max_heap_table_size;
@@global.max_heap_table_size
16777216
SELECT @@global.replica_net_timeout;
@@global.replica_net_timeout
60
# Expected value 1
SELECT @@global.foreign_key_checks;
@@global.foreign_key_checks
1
# Expected value 0
SELECT @@global.flush_time;
@@global.flush_time
0
# reset some persisted values
RESET PERSIST sort_buffer_size;
RESET PERSIST replica_net_timeout;
# Restart server with persisted-globals-load=1
# should have default values
SELECT @@global.sort_buffer_size;
@@global.sort_buffer_size
262144
SELECT @@global.replica_net_timeout;
@@global.replica_net_timeout
60
SELECT @@global.max_heap_table_size;
@@global.max_heap_table_size
999424
# Expected value 0
SELECT @@global.foreign_key_checks;
@@global.foreign_key_checks
0
# Expected value 2
SELECT @@global.flush_time;
@@global.flush_time
2
call mtr.add_suppression("\\[Warning\\] \\[[^]]*\\] \\[[^]]*\\] option 'persisted_globals_load': boolean value 'NULL' was not recognized. Set to OFF.");
call mtr.add_suppression("\\[Warning\\] option 'persisted_globals_load': boolean value 'NULL' was not recognized. Set to OFF.");
# Restart server with persisted-globals-load=NULL
# Should get warning in error log.
Pattern "persisted_globals_load" found
SELECT @@global.persisted_globals_load;
@@global.persisted_globals_load
0
# Restart server with persisted-globals-load=1
#
# Bug24569624: "SET PERSIST GENERAL_LOG=1" DOES NOT RESUME ON RESTART.
#
SET PERSIST general_log=ON;
SET PERSIST autocommit= 0, innodb_deadlock_detect= OFF;
SET PERSIST enforce_gtid_consistency=ON;
SELECT @@global.general_log, @@global.autocommit,
@@global.innodb_deadlock_detect, @@global.enforce_gtid_consistency;
@@global.general_log	@@global.autocommit	@@global.innodb_deadlock_detect	@@global.enforce_gtid_consistency
1	0	0	ON
# Restart server
SELECT @@global.general_log, @@global.autocommit,
@@global.innodb_deadlock_detect, @@global.enforce_gtid_consistency;
@@global.general_log	@@global.autocommit	@@global.innodb_deadlock_detect	@@global.enforce_gtid_consistency
1	0	0	ON
#
# Bug#24613005: SET PERSIST STORES PREVIOUS VALUE OF
#               INNODB_BUFFER_POOL_SIZE TO MYSQLD-AUTO.CNF
#
SELECT @@global.innodb_buffer_pool_size;
@@global.innodb_buffer_pool_size
25165824
SET PERSIST innodb_buffer_pool_size=10*1024*1024;
Warnings:
Warning	1210	InnoDB: Cannot resize buffer pool to lesser than chunk size of 25165824 bytes.
SELECT @@global.innodb_buffer_pool_size;
@@global.innodb_buffer_pool_size
25165824
# Restart server
# restart
SELECT @@global.innodb_buffer_pool_size;
@@global.innodb_buffer_pool_size
25165824
SELECT * FROM performance_schema.persisted_variables ORDER BY 1;
VARIABLE_NAME	VARIABLE_VALUE
autocommit	OFF
enforce_gtid_consistency	ON
general_log	ON
innodb_buffer_pool_size	25165824
innodb_deadlock_detect	OFF

#
# Bug#26085712: SERVER FAILS TO START AFTER SET PERSIST GTID_MODE
#                = ON_PERMISSIVE OR ON
#
RESET PERSIST;
SELECT @@gtid_mode;
@@gtid_mode
OFF
SET PERSIST gtid_mode=OFF_PERMISSIVE;
SET PERSIST gtid_mode=ON_PERMISSIVE;
SELECT @@gtid_mode;
@@gtid_mode
ON_PERMISSIVE
# Restart server and check for gtid_mode value
# restart
SELECT @@gtid_mode;
@@gtid_mode
ON_PERMISSIVE
RESET PERSIST;
# Restart server with all defaults
# restart
#
# Bug #33417357: RESET PERSIST THROWS SYNTAX ERROR WITH COMPONENT SYSTEM VARIABLES
#
#
# 1. test MyISAM Multiple Key Cache variables:
#
SET PERSIST default.key_buffer_size = 1024*1024;
Warnings:
Warning	1287	default.key_buffer_size syntax is deprecated and will be removed in a future release
RESET PERSIST default.key_buffer_size;
SET GLOBAL default.key_buffer_size = DEFAULT;
Warnings:
Warning	1287	default.key_buffer_size syntax is deprecated and will be removed in a future release
#
# 2. test component-registered variable names:
#
call mtr.add_suppression("Duplicate variable name 'test_component.int_sys_var'");
INSTALL COMPONENT "file://component_test_sys_var_service";
SET PERSIST test_component.str_sys_var = 'test';
# restart
# Should return "test":
SELECT @@global.test_component.str_sys_var;
@@global.test_component.str_sys_var
test
UNINSTALL COMPONENT "file://component_test_sys_var_service";
call mtr.add_suppression("Currently unknown variable 'test_component.str_sys_var' was read from the persisted config file");
# restart
SELECT @@global.test_component.str_sys_var;
ERROR HY000: Unknown system variable 'test_component.str_sys_var'
INSTALL COMPONENT "file://component_test_sys_var_service";
# Should return "test":
SELECT @@global.test_component.str_sys_var;
@@global.test_component.str_sys_var
test
RESET PERSIST test_component.str_sys_var;
# Should return "test":
SELECT @@global.test_component.str_sys_var;
@@global.test_component.str_sys_var
test
# restart
# Should return NULL:
SELECT @@global.test_component.str_sys_var;
@@global.test_component.str_sys_var
NULL
UNINSTALL COMPONENT "file://component_test_sys_var_service";
# END OF TEST