-
Notifications
You must be signed in to change notification settings - Fork 4k
/
Copy pathsys_vars.cc
7589 lines (6654 loc) · 313 KB
/
sys_vars.cc
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
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* Copyright (c) 2009, 2024, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.
This program is designed to work with certain software (including
but not limited to OpenSSL) that is licensed under separate terms,
as designated in a particular file or component or in included license
documentation. The authors of MySQL hereby grant you an additional
permission to link the program and your derivative works with the
separately licensed software that they have either included with
the program or referenced in the documentation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License, version 2.0, for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
Definitions of all server's session or global variables.
How to add new variables:
1. copy one of the existing variables, and edit the declaration.
2. if you need special behavior on assignment or additional checks
use ON_CHECK and ON_UPDATE callbacks.
3. *Don't* add new Sys_var classes or uncle Occam will come
with his razor to haunt you at nights
Note - all storage engine variables (for example myisam_whatever)
should go into the corresponding storage engine sources
(for example in storage/myisam/ha_myisam.cc) !
*/
#include "sql/sys_vars.h"
#include "my_config.h"
#include <assert.h>
#include <limits.h>
#include <math.h>
#include <stdint.h>
#include <stdio.h>
#include <sys/stat.h>
#include <zlib.h>
#include <atomic>
#include <limits>
#include "include/compression.h"
#include "mysql/components/services/log_builtins.h"
#include "mysql/components/services/log_shared.h"
#include "mysql/my_loglevel.h"
#include "mysql_com.h"
#include "sql/auth/authentication_policy.h"
#include "sql/protocol.h"
#include "sql/rpl_trx_tracking.h"
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <algorithm>
#include <map>
#include <utility>
#include "ft_global.h"
#include "m_string.h"
#include "my_aes.h" // my_aes_opmode_names
#include "my_command.h"
#include "my_compiler.h"
#include "my_dbug.h"
#include "my_dir.h"
#include "my_double2ulonglong.h"
#include "my_io.h"
#include "my_macros.h"
#include "my_sqlcommand.h"
#include "my_thread.h"
#include "my_thread_local.h"
#include "my_time.h"
#include "myisam.h" // myisam_flush
#include "mysql/binlog/event/binlog_event.h" // mysql::binlog::event::max_log_event_size
#include "mysql/binlog/event/compression/zstd_comp.h" // DEFAULT_COMPRESSION_LEVEL
#include "mysql/plugin_group_replication.h"
#include "mysql/psi/mysql_mutex.h"
#include "mysql/strings/dtoa.h"
#include "mysql/strings/int2str.h"
#include "mysql/strings/m_ctype.h"
#include "mysql_version.h"
#include "nulls.h"
#include "sql-common/my_decimal.h"
#include "sql/auth/auth_acls.h"
#include "sql/auth/auth_common.h" // validate_user_plugins
#include "sql/binlog.h" // mysql_bin_log
#include "sql/changestreams/apply/replication_thread_status.h"
#include "sql/clone_handler.h"
#include "sql/conn_handler/connection_handler_impl.h" // Per_thread_connection_handler
#include "sql/conn_handler/connection_handler_manager.h" // Connection_handler_manager
#include "sql/conn_handler/socket_connection.h" // MY_BIND_ALL_ADDRESSES
#include "sql/derror.h" // read_texts
#include "sql/discrete_interval.h"
#include "sql/events.h" // Events
#include "sql/hostname_cache.h" // host_cache_resize
#include "sql/log.h"
#include "sql/mdl.h"
#include "sql/opt_trace_context.h"
#include "sql/options_mysqld.h"
#include "sql/protocol_classic.h"
#include "sql/psi_memory_key.h"
#include "sql/query_options.h"
#include "sql/rpl_group_replication.h" // is_group_replication_running
#include "sql/rpl_handler.h" // delegates_update_lock_type
#include "sql/rpl_info_factory.h" // Rpl_info_factory
#include "sql/rpl_info_handler.h" // INFO_REPOSITORY_TABLE
#include "sql/rpl_log_encryption.h"
#include "sql/rpl_mi.h" // Master_info
#include "sql/rpl_msr.h" // channel_map
#include "sql/rpl_mta_submode.h" // MTS_PARALLEL_TYPE_DB_NAME
#include "sql/rpl_replica.h" // SLAVE_THD_TYPE
#include "sql/rpl_rli.h" // Relay_log_info
#include "sql/server_component/log_builtins_filter_imp.h" // until we have pluggable variables
#include "sql/server_component/log_builtins_imp.h"
#include "sql/session_tracker.h"
#include "sql/sp_head.h" // SP_PSI_STATEMENT_INFO_COUNT
#include "sql/sql_lex.h"
#include "sql/sql_locale.h" // my_locale_by_number
#include "sql/sql_parse.h" // killall_non_super_threads
#include "sql/sql_show_processlist.h" // pfs_processlist_enabled
#include "sql/sql_tmp_table.h" // internal_tmp_mem_storage_engine_names
#include "sql/ssl_acceptor_context_operator.h"
#include "sql/statement/statement.h" // STMT_HANDLE_PSI_STATEMENT_INFO_COUNT
#include "sql/system_variables.h"
#include "sql/table_cache.h" // Table_cache_manager
#include "sql/transaction.h" // trans_commit_stmt
#include "sql/transaction_info.h"
#include "sql/xa.h"
#include "string_with_len.h"
#include "template_utils.h" // pointer_cast
#include "thr_lock.h"
#ifdef _WIN32
#include "sql/named_pipe.h"
#endif
#include "my_openssl_fips.h"
#ifdef WITH_LOCK_ORDER
#include "sql/debug_lock_order.h"
#endif /* WITH_LOCK_ORDER */
#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
#include "storage/perfschema/pfs_server.h"
#include "storage/perfschema/terminology_use_previous.h"
#endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */
static constexpr const unsigned long DEFAULT_ERROR_COUNT{1024};
static constexpr const unsigned long DEFAULT_SORT_MEMORY{256UL * 1024UL};
static constexpr const unsigned HOST_CACHE_SIZE{128};
static constexpr const unsigned long SCHEMA_DEF_CACHE_DEFAULT{256};
static constexpr const unsigned long STORED_PROGRAM_DEF_CACHE_DEFAULT{256};
static constexpr const unsigned long TABLESPACE_DEF_CACHE_DEFAULT{256};
/**
We must have room for at least 400 table definitions in the table
cache, since otherwise there is no chance prepared
statements that use these many tables can work.
Prepared statements use table definition cache ids (table_map_id)
as table version identifiers. If the table definition
cache size is less than the number of tables used in a statement,
the contents of the table definition cache is guaranteed to rotate
between a prepare and execute. This leads to stable validation
errors. In future we shall use more stable version identifiers,
for now the only solution is to ensure that the table definition
cache can contain at least all tables of a given statement.
*/
static constexpr const unsigned long TABLE_DEF_CACHE_MIN{400};
static constexpr const unsigned long SCHEMA_DEF_CACHE_MIN{256};
static constexpr const unsigned long STORED_PROGRAM_DEF_CACHE_MIN{256};
static constexpr const unsigned long TABLESPACE_DEF_CACHE_MIN{256};
/*
Default time to wait before aborting a new client connection
that does not respond to "initial server greeting" timely
*/
static constexpr const unsigned long CONNECT_TIMEOUT{10};
/* Defaults for deprecated "insert delayed" */
static constexpr const unsigned long DELAYED_LIMIT{100};
static constexpr const unsigned long DELAYED_QUEUE_SIZE{1000};
static constexpr const unsigned long DELAYED_WAIT_TIMEOUT{5 * 60};
static constexpr const unsigned long QUERY_ALLOC_BLOCK_SIZE{8192};
static constexpr const unsigned long QUERY_ALLOC_PREALLOC_SIZE{8192};
static constexpr const unsigned long TRANS_ALLOC_PREALLOC_SIZE{4096};
static constexpr const unsigned long RANGE_ALLOC_BLOCK_SIZE{4096};
// Including the switch in this set, makes its default 'on'
static constexpr const unsigned long long OPTIMIZER_SWITCH_DEFAULT{
OPTIMIZER_SWITCH_INDEX_MERGE | OPTIMIZER_SWITCH_INDEX_MERGE_UNION |
OPTIMIZER_SWITCH_INDEX_MERGE_SORT_UNION |
OPTIMIZER_SWITCH_INDEX_MERGE_INTERSECT |
OPTIMIZER_SWITCH_ENGINE_CONDITION_PUSHDOWN |
OPTIMIZER_SWITCH_INDEX_CONDITION_PUSHDOWN | OPTIMIZER_SWITCH_MRR |
OPTIMIZER_SWITCH_MRR_COST_BASED | OPTIMIZER_SWITCH_BNL |
OPTIMIZER_SWITCH_MATERIALIZATION | OPTIMIZER_SWITCH_SEMIJOIN |
OPTIMIZER_SWITCH_LOOSE_SCAN | OPTIMIZER_SWITCH_FIRSTMATCH |
OPTIMIZER_SWITCH_DUPSWEEDOUT | OPTIMIZER_SWITCH_SUBQ_MAT_COST_BASED |
OPTIMIZER_SWITCH_USE_INDEX_EXTENSIONS |
OPTIMIZER_SWITCH_COND_FANOUT_FILTER | OPTIMIZER_SWITCH_DERIVED_MERGE |
OPTIMIZER_SKIP_SCAN | OPTIMIZER_SWITCH_HASH_JOIN |
OPTIMIZER_SWITCH_PREFER_ORDERING_INDEX |
OPTIMIZER_SWITCH_DERIVED_CONDITION_PUSHDOWN |
OPTIMIZER_SWITCH_HASH_SET_OPERATIONS};
static constexpr const unsigned long MYSQLD_NET_RETRY_COUNT{10};
TYPELIB bool_typelib = {array_elements(bool_values) - 1, "", bool_values,
nullptr};
static bool update_buffer_size(THD *, KEY_CACHE *key_cache,
ptrdiff_t offset [[maybe_unused]],
ulonglong new_value) {
bool error = false;
assert(offset == offsetof(KEY_CACHE, param_buff_size));
if (new_value == 0) {
if (key_cache == dflt_key_cache) {
my_error(ER_WARN_CANT_DROP_DEFAULT_KEYCACHE, MYF(0));
return true;
}
if (key_cache->key_cache_inited) // If initied
{
/*
Move tables using this key cache to the default key cache
and clear the old key cache.
*/
key_cache->in_init = true;
mysql_mutex_unlock(&LOCK_global_system_variables);
key_cache->param_buff_size = 0;
ha_resize_key_cache(key_cache);
ha_change_key_cache(key_cache, dflt_key_cache);
/*
We don't delete the key cache as some running threads my still be in
the key cache code with a pointer to the deleted (empty) key cache
*/
mysql_mutex_lock(&LOCK_global_system_variables);
key_cache->in_init = false;
}
return error;
}
key_cache->param_buff_size = new_value;
/* If key cache didn't exist initialize it, else resize it */
key_cache->in_init = true;
mysql_mutex_unlock(&LOCK_global_system_variables);
if (!key_cache->key_cache_inited)
error = ha_init_key_cache({}, key_cache);
else
error = ha_resize_key_cache(key_cache);
mysql_mutex_lock(&LOCK_global_system_variables);
key_cache->in_init = false;
return error;
}
static bool update_keycache_param(THD *, KEY_CACHE *key_cache, ptrdiff_t offset,
ulonglong new_value) {
bool error = false;
assert(offset != offsetof(KEY_CACHE, param_buff_size));
keycache_var(key_cache, offset) = new_value;
key_cache->in_init = true;
mysql_mutex_unlock(&LOCK_global_system_variables);
error = ha_resize_key_cache(key_cache);
mysql_mutex_lock(&LOCK_global_system_variables);
key_cache->in_init = false;
return error;
}
/**
Check if correct privileges for GTID_NEXT tagged are granted.
Throw SQL error if not.
Use this when setting session variables that are to be protected within
replication applier context.
@retval true failure
@retval false success
@param self the system variable to set value for
@param thd the session context
@param setv the SET operations metadata
*/
static bool check_tagged_gtid_next_privileges(sys_var *self [[maybe_unused]],
THD *thd, set_var *setv) {
assert(self->scope() != sys_var::GLOBAL);
Security_context *sctx = thd->security_context();
if ((setv->type == OPT_SESSION || setv->type == OPT_DEFAULT) &&
((!sctx->has_global_grant(STRING_WITH_LEN("SESSION_VARIABLES_ADMIN"))
.first &&
!sctx->has_global_grant(STRING_WITH_LEN("SYSTEM_VARIABLES_ADMIN"))
.first &&
!sctx->has_global_grant(STRING_WITH_LEN("REPLICATION_APPLIER"))
.first) ||
!sctx->has_global_grant(STRING_WITH_LEN("TRANSACTION_GTID_TAG"))
.first)) {
my_error(ER_SPECIFIC_ACCESS_DENIED, MYF(0),
"the TRANSACTION_GTID_TAG and at least one of the: "
"SYSTEM_VARIABLES_ADMIN, SESSION_VARIABLES_ADMIN or "
"REPLICATION_APPLIER");
return true;
}
return false;
}
/**
Check if REPLICATION_APPLIER granted. Throw SQL error if not.
Use this when setting session variables that are to be protected within
replication applier context.
@note For compatibility we also accept SUPER.
@retval true failure
@retval false success
@param self the system variable to set value for
@param thd the session context
@param setv the SET operations metadata
*/
static bool check_session_admin_or_replication_applier(sys_var *self
[[maybe_unused]],
THD *thd,
set_var *setv) {
assert(self->scope() != sys_var::GLOBAL);
Security_context *sctx = thd->security_context();
if ((setv->type == OPT_SESSION || setv->type == OPT_DEFAULT) &&
!sctx->has_global_grant(STRING_WITH_LEN("REPLICATION_APPLIER")).first &&
!sctx->has_global_grant(STRING_WITH_LEN("SESSION_VARIABLES_ADMIN"))
.first &&
!sctx->has_global_grant(STRING_WITH_LEN("SYSTEM_VARIABLES_ADMIN"))
.first &&
!sctx->check_access(SUPER_ACL)) {
my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0),
"SUPER, SYSTEM_VARIABLES_ADMIN, SESSION_VARIABLES_ADMIN or "
"REPLICATION_APPLIER");
return true;
}
return false;
}
/**
Utility method that checks if user has correct session administrative
dynamic privileges.
@return 0 on success, 1 on failure.
*/
static bool check_session_admin_privileges_only(sys_var *self [[maybe_unused]],
THD *thd, set_var *setv) {
// Privilege check for global variable must have already done before.
assert(self->scope() != sys_var::GLOBAL);
Security_context *sctx = thd->security_context();
if ((setv->type == OPT_SESSION || setv->type == OPT_DEFAULT) &&
!sctx->has_global_grant(STRING_WITH_LEN("SESSION_VARIABLES_ADMIN"))
.first &&
!sctx->has_global_grant(STRING_WITH_LEN("SYSTEM_VARIABLES_ADMIN"))
.first) {
return true;
}
return false;
}
/**
Check if SESSION_VARIABLES_ADMIN granted. Throw SQL error if not.
Use this when setting session variables that are sensitive and should
be protected.
We also accept SYSTEM_VARIABLES_ADMIN since it doesn't make a lot of
sense to be allowed to set the global variable and not the session ones.
@retval true failure
@retval false success
@param self the system variable to set value for
@param thd the session context
@param setv the SET operations metadata
*/
static bool check_session_admin_no_super(sys_var *self, THD *thd,
set_var *setv) {
if (check_session_admin_privileges_only(self, thd, setv)) {
my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0),
"SYSTEM_VARIABLES_ADMIN or SESSION_VARIABLES_ADMIN");
return true;
}
return false;
}
/**
Check if SESSION_VARIABLES_ADMIN granted. Throw SQL error if not.
Use this when setting session variables that are sensitive and should
be protected.
We also accept SYSTEM_VARIABLES_ADMIN since it doesn't make a lot of
sense to be allowed to set the global variable and not the session ones.
@note For compatibility we also accept SUPER.
@retval true failure
@retval false success
@param self the system variable to set value for
@param thd the session context
@param setv the SET operations metadata
*/
static bool check_session_admin(sys_var *self, THD *thd, set_var *setv) {
Security_context *sctx = thd->security_context();
if (check_session_admin_privileges_only(self, thd, setv) &&
!sctx->check_access(SUPER_ACL)) {
my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0),
"SUPER, SYSTEM_VARIABLES_ADMIN or SESSION_VARIABLES_ADMIN");
return true;
}
return false;
}
/*
The rule for this file: everything should be 'static'. When a sys_var
variable or a function from this file is - in very rare cases - needed
elsewhere it should be explicitly declared 'export' here to show that it's
not a mistakenly forgotten 'static' keyword.
*/
#define export /* not static */
#ifdef WITH_LOCK_ORDER
#define LO_TRAILING_PROPERTIES \
NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(NULL), ON_UPDATE(NULL), nullptr, \
sys_var::PARSE_EARLY
static Sys_var_bool Sys_lo_enabled("lock_order", "Enable the lock order.",
READ_ONLY GLOBAL_VAR(lo_param.m_enabled),
CMD_LINE(OPT_ARG), DEFAULT(false),
LO_TRAILING_PROPERTIES);
static Sys_var_charptr Sys_lo_out_dir("lock_order_output_directory",
"Lock order output directory.",
READ_ONLY GLOBAL_VAR(lo_param.m_out_dir),
CMD_LINE(OPT_ARG), IN_FS_CHARSET,
DEFAULT(nullptr), LO_TRAILING_PROPERTIES);
static Sys_var_charptr Sys_lo_dep_1(
"lock_order_dependencies", "Lock order dependencies file.",
READ_ONLY GLOBAL_VAR(lo_param.m_dependencies_1), CMD_LINE(OPT_ARG),
IN_FS_CHARSET, DEFAULT(nullptr), LO_TRAILING_PROPERTIES);
static Sys_var_charptr Sys_lo_dep_2(
"lock_order_extra_dependencies", "Lock order extra dependencies file.",
READ_ONLY GLOBAL_VAR(lo_param.m_dependencies_2), CMD_LINE(OPT_ARG),
IN_FS_CHARSET, DEFAULT(nullptr), LO_TRAILING_PROPERTIES);
static Sys_var_bool Sys_lo_print_txt("lock_order_print_txt",
"Print the lock_order.txt file.",
READ_ONLY GLOBAL_VAR(lo_param.m_print_txt),
CMD_LINE(OPT_ARG), DEFAULT(false),
LO_TRAILING_PROPERTIES);
static Sys_var_bool Sys_lo_trace_loop(
"lock_order_trace_loop", "Enable tracing for all loops.",
READ_ONLY GLOBAL_VAR(lo_param.m_trace_loop), CMD_LINE(OPT_ARG),
DEFAULT(false), LO_TRAILING_PROPERTIES);
static Sys_var_bool Sys_lo_debug_loop(
"lock_order_debug_loop", "Enable debugging for all loops.",
READ_ONLY GLOBAL_VAR(lo_param.m_debug_loop), CMD_LINE(OPT_ARG),
DEFAULT(false), LO_TRAILING_PROPERTIES);
static Sys_var_bool Sys_lo_trace_missing_arc(
"lock_order_trace_missing_arc", "Enable tracing for all missing arcs.",
READ_ONLY GLOBAL_VAR(lo_param.m_trace_missing_arc), CMD_LINE(OPT_ARG),
DEFAULT(true), LO_TRAILING_PROPERTIES);
static Sys_var_bool Sys_lo_debug_missing_arc(
"lock_order_debug_missing_arc", "Enable debugging for all missing arcs.",
READ_ONLY GLOBAL_VAR(lo_param.m_debug_missing_arc), CMD_LINE(OPT_ARG),
DEFAULT(false), LO_TRAILING_PROPERTIES);
static Sys_var_bool Sys_lo_trace_missing_unlock(
"lock_order_trace_missing_unlock", "Enable tracing for all missing unlocks",
READ_ONLY GLOBAL_VAR(lo_param.m_trace_missing_unlock), CMD_LINE(OPT_ARG),
DEFAULT(true), LO_TRAILING_PROPERTIES);
static Sys_var_bool Sys_lo_debug_missing_unlock(
"lock_order_debug_missing_unlock",
"Enable debugging for all missing unlocks",
READ_ONLY GLOBAL_VAR(lo_param.m_debug_missing_unlock), CMD_LINE(OPT_ARG),
DEFAULT(false), LO_TRAILING_PROPERTIES);
static Sys_var_bool Sys_lo_trace_missing_key(
"lock_order_trace_missing_key",
"Enable trace for missing performance schema keys",
READ_ONLY GLOBAL_VAR(lo_param.m_trace_missing_key), CMD_LINE(OPT_ARG),
DEFAULT(false), LO_TRAILING_PROPERTIES);
static Sys_var_bool Sys_lo_debug_missing_key(
"lock_order_debug_missing_key",
"Enable debugging for missing performance schema keys",
READ_ONLY GLOBAL_VAR(lo_param.m_debug_missing_key), CMD_LINE(OPT_ARG),
DEFAULT(false), LO_TRAILING_PROPERTIES);
#endif /* WITH_LOCK_ORDER */
#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
#define PFS_TRAILING_PROPERTIES \
NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(nullptr), ON_UPDATE(nullptr), \
nullptr, sys_var::PARSE_EARLY
static Sys_var_bool Sys_pfs_enabled("performance_schema",
"Enable the performance schema.",
READ_ONLY GLOBAL_VAR(pfs_param.m_enabled),
CMD_LINE(OPT_ARG), DEFAULT(true),
PFS_TRAILING_PROPERTIES);
static Sys_var_charptr Sys_pfs_instrument(
"performance_schema_instrument",
"Default startup value for a performance schema instrument.",
READ_ONLY NOT_VISIBLE GLOBAL_VAR(pfs_param.m_pfs_instrument),
CMD_LINE(OPT_ARG, OPT_PFS_INSTRUMENT), IN_FS_CHARSET, DEFAULT(""),
PFS_TRAILING_PROPERTIES);
static Sys_var_charptr Sys_pfs_meter(
"performance_schema_meter",
"Default startup value for a performance schema meter.",
READ_ONLY NOT_VISIBLE GLOBAL_VAR(pfs_param.m_pfs_meter),
CMD_LINE(OPT_ARG, OPT_PFS_METER), IN_FS_CHARSET, DEFAULT(""),
PFS_TRAILING_PROPERTIES);
static Sys_var_charptr Sys_pfs_logger(
"performance_schema_logger",
"Default startup value for a performance schema logger.",
READ_ONLY NOT_VISIBLE GLOBAL_VAR(pfs_param.m_pfs_logger),
CMD_LINE(OPT_ARG, OPT_PFS_LOGGER), IN_FS_CHARSET, DEFAULT(""),
PFS_TRAILING_PROPERTIES);
/**
Update the performance_schema_show_processlist.
Warn that the use of information_schema processlist is deprecated.
*/
static bool performance_schema_show_processlist_update(sys_var *, THD *thd,
enum_var_type) {
push_warning_printf(thd, Sql_condition::SL_WARNING,
ER_WARN_DEPRECATED_WITH_NOTE,
ER_THD(thd, ER_WARN_DEPRECATED_WITH_NOTE),
"@@performance_schema_show_processlist",
"When it is removed, SHOW PROCESSLIST will always use the"
" performance schema implementation.");
return false;
}
static Sys_var_bool Sys_pfs_processlist(
"performance_schema_show_processlist",
"Default startup value to enable SHOW PROCESSLIST "
"in the performance schema.",
GLOBAL_VAR(pfs_processlist_enabled), CMD_LINE(OPT_ARG), DEFAULT(false),
NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(nullptr),
ON_UPDATE(performance_schema_show_processlist_update), nullptr,
sys_var::PARSE_NORMAL);
static Sys_var_bool Sys_pfs_consumer_events_stages_current(
"performance_schema_consumer_events_stages_current",
"Default startup value for the events_stages_current consumer.",
READ_ONLY NOT_VISIBLE
GLOBAL_VAR(pfs_param.m_consumer_events_stages_current_enabled),
CMD_LINE(OPT_ARG), DEFAULT(false), PFS_TRAILING_PROPERTIES);
static Sys_var_bool Sys_pfs_consumer_events_stages_history(
"performance_schema_consumer_events_stages_history",
"Default startup value for the events_stages_history consumer.",
READ_ONLY NOT_VISIBLE
GLOBAL_VAR(pfs_param.m_consumer_events_stages_history_enabled),
CMD_LINE(OPT_ARG), DEFAULT(false), PFS_TRAILING_PROPERTIES);
static Sys_var_bool Sys_pfs_consumer_events_stages_history_long(
"performance_schema_consumer_events_stages_history_long",
"Default startup value for the events_stages_history_long consumer.",
READ_ONLY NOT_VISIBLE
GLOBAL_VAR(pfs_param.m_consumer_events_stages_history_long_enabled),
CMD_LINE(OPT_ARG), DEFAULT(false), PFS_TRAILING_PROPERTIES);
static Sys_var_bool Sys_pfs_consumer_events_statements_cpu(
"performance_schema_consumer_events_statements_cpu",
"Default startup value for the events_statements_cpu consumer.",
READ_ONLY NOT_VISIBLE
GLOBAL_VAR(pfs_param.m_consumer_events_statements_cpu_enabled),
CMD_LINE(OPT_ARG), DEFAULT(false), PFS_TRAILING_PROPERTIES);
static Sys_var_bool Sys_pfs_consumer_events_statements_current(
"performance_schema_consumer_events_statements_current",
"Default startup value for the events_statements_current consumer.",
READ_ONLY NOT_VISIBLE
GLOBAL_VAR(pfs_param.m_consumer_events_statements_current_enabled),
CMD_LINE(OPT_ARG), DEFAULT(true), PFS_TRAILING_PROPERTIES);
static Sys_var_bool Sys_pfs_consumer_events_statements_history(
"performance_schema_consumer_events_statements_history",
"Default startup value for the events_statements_history consumer.",
READ_ONLY NOT_VISIBLE
GLOBAL_VAR(pfs_param.m_consumer_events_statements_history_enabled),
CMD_LINE(OPT_ARG), DEFAULT(true), PFS_TRAILING_PROPERTIES);
static Sys_var_bool Sys_pfs_consumer_events_statements_history_long(
"performance_schema_consumer_events_statements_history_long",
"Default startup value for the events_statements_history_long consumer.",
READ_ONLY NOT_VISIBLE
GLOBAL_VAR(pfs_param.m_consumer_events_statements_history_long_enabled),
CMD_LINE(OPT_ARG), DEFAULT(false), PFS_TRAILING_PROPERTIES);
static Sys_var_bool Sys_pfs_consumer_events_transactions_current(
"performance_schema_consumer_events_transactions_current",
"Default startup value for the events_transactions_current consumer.",
READ_ONLY NOT_VISIBLE
GLOBAL_VAR(pfs_param.m_consumer_events_transactions_current_enabled),
CMD_LINE(OPT_ARG), DEFAULT(true), PFS_TRAILING_PROPERTIES);
static Sys_var_bool Sys_pfs_consumer_events_transactions_history(
"performance_schema_consumer_events_transactions_history",
"Default startup value for the events_transactions_history consumer.",
READ_ONLY NOT_VISIBLE
GLOBAL_VAR(pfs_param.m_consumer_events_transactions_history_enabled),
CMD_LINE(OPT_ARG), DEFAULT(true), PFS_TRAILING_PROPERTIES);
static Sys_var_bool Sys_pfs_consumer_events_transactions_history_long(
"performance_schema_consumer_events_transactions_history_long",
"Default startup value for the events_transactions_history_long consumer.",
READ_ONLY NOT_VISIBLE GLOBAL_VAR(
pfs_param.m_consumer_events_transactions_history_long_enabled),
CMD_LINE(OPT_ARG), DEFAULT(false), PFS_TRAILING_PROPERTIES);
static Sys_var_bool Sys_pfs_consumer_events_waits_current(
"performance_schema_consumer_events_waits_current",
"Default startup value for the events_waits_current consumer.",
READ_ONLY NOT_VISIBLE
GLOBAL_VAR(pfs_param.m_consumer_events_waits_current_enabled),
CMD_LINE(OPT_ARG), DEFAULT(false), PFS_TRAILING_PROPERTIES);
static Sys_var_bool Sys_pfs_consumer_events_waits_history(
"performance_schema_consumer_events_waits_history",
"Default startup value for the events_waits_history consumer.",
READ_ONLY NOT_VISIBLE
GLOBAL_VAR(pfs_param.m_consumer_events_waits_history_enabled),
CMD_LINE(OPT_ARG), DEFAULT(false), PFS_TRAILING_PROPERTIES);
static Sys_var_bool Sys_pfs_consumer_events_waits_history_long(
"performance_schema_consumer_events_waits_history_long",
"Default startup value for the events_waits_history_long consumer.",
READ_ONLY NOT_VISIBLE
GLOBAL_VAR(pfs_param.m_consumer_events_waits_history_long_enabled),
CMD_LINE(OPT_ARG), DEFAULT(false), PFS_TRAILING_PROPERTIES);
static Sys_var_bool Sys_pfs_consumer_global_instrumentation(
"performance_schema_consumer_global_instrumentation",
"Default startup value for the global_instrumentation consumer.",
READ_ONLY NOT_VISIBLE
GLOBAL_VAR(pfs_param.m_consumer_global_instrumentation_enabled),
CMD_LINE(OPT_ARG), DEFAULT(true), PFS_TRAILING_PROPERTIES);
static Sys_var_bool Sys_pfs_consumer_thread_instrumentation(
"performance_schema_consumer_thread_instrumentation",
"Default startup value for the thread_instrumentation consumer.",
READ_ONLY NOT_VISIBLE
GLOBAL_VAR(pfs_param.m_consumer_thread_instrumentation_enabled),
CMD_LINE(OPT_ARG), DEFAULT(true), PFS_TRAILING_PROPERTIES);
static Sys_var_bool Sys_pfs_consumer_statement_digest(
"performance_schema_consumer_statements_digest",
"Default startup value for the statements_digest consumer.",
READ_ONLY NOT_VISIBLE
GLOBAL_VAR(pfs_param.m_consumer_statement_digest_enabled),
CMD_LINE(OPT_ARG), DEFAULT(true), PFS_TRAILING_PROPERTIES);
static Sys_var_long Sys_pfs_events_waits_history_long_size(
"performance_schema_events_waits_history_long_size",
"Number of rows in EVENTS_WAITS_HISTORY_LONG."
" Use 0 to disable, -1 for automated sizing.",
READ_ONLY GLOBAL_VAR(pfs_param.m_events_waits_history_long_sizing),
CMD_LINE(REQUIRED_ARG), VALID_RANGE(-1, 1024 * 1024),
DEFAULT(PFS_AUTOSIZE_VALUE), BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES);
static Sys_var_long Sys_pfs_events_waits_history_size(
"performance_schema_events_waits_history_size",
"Number of rows per thread in EVENTS_WAITS_HISTORY."
" Use 0 to disable, -1 for automated sizing.",
READ_ONLY GLOBAL_VAR(pfs_param.m_events_waits_history_sizing),
CMD_LINE(REQUIRED_ARG), VALID_RANGE(-1, 1024), DEFAULT(PFS_AUTOSIZE_VALUE),
BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES);
static Sys_var_ulong Sys_pfs_max_cond_classes(
"performance_schema_max_cond_classes",
"Maximum number of condition instruments.",
READ_ONLY GLOBAL_VAR(pfs_param.m_cond_class_sizing), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(0, 1024), DEFAULT(PFS_MAX_COND_CLASS), BLOCK_SIZE(1),
PFS_TRAILING_PROPERTIES);
static Sys_var_long Sys_pfs_max_cond_instances(
"performance_schema_max_cond_instances",
"Maximum number of instrumented condition objects."
" Use 0 to disable, -1 for automated scaling.",
READ_ONLY GLOBAL_VAR(pfs_param.m_cond_sizing), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(-1, 1024 * 1024), DEFAULT(PFS_AUTOSCALE_VALUE), BLOCK_SIZE(1),
PFS_TRAILING_PROPERTIES);
static Sys_var_long Sys_pfs_max_program_instances(
"performance_schema_max_program_instances",
"Maximum number of instrumented programs."
" Use 0 to disable, -1 for automated scaling.",
READ_ONLY GLOBAL_VAR(pfs_param.m_program_sizing), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(-1, 1024 * 1024), DEFAULT(PFS_AUTOSCALE_VALUE), BLOCK_SIZE(1),
PFS_TRAILING_PROPERTIES);
static constexpr int num_prepared_stmt_limit = 4 * 1024 * 1024;
static Sys_var_long Sys_pfs_max_prepared_stmt_instances(
"performance_schema_max_prepared_statements_instances",
"Maximum number of instrumented prepared statements."
" Use 0 to disable, -1 for automated scaling.",
READ_ONLY GLOBAL_VAR(pfs_param.m_prepared_stmt_sizing),
CMD_LINE(REQUIRED_ARG), VALID_RANGE(-1, num_prepared_stmt_limit),
DEFAULT(PFS_AUTOSCALE_VALUE), BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES);
static Sys_var_ulong Sys_pfs_max_file_classes(
"performance_schema_max_file_classes",
"Maximum number of file instruments.",
READ_ONLY GLOBAL_VAR(pfs_param.m_file_class_sizing), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(0, 1024), DEFAULT(PFS_MAX_FILE_CLASS), BLOCK_SIZE(1),
PFS_TRAILING_PROPERTIES);
static Sys_var_ulong Sys_pfs_max_file_handles(
"performance_schema_max_file_handles",
"Maximum number of opened instrumented files.",
READ_ONLY GLOBAL_VAR(pfs_param.m_file_handle_sizing),
CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 1024 * 1024),
DEFAULT(PFS_MAX_FILE_HANDLE), BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES);
static Sys_var_long Sys_pfs_max_file_instances(
"performance_schema_max_file_instances",
"Maximum number of instrumented files."
" Use 0 to disable, -1 for automated scaling.",
READ_ONLY GLOBAL_VAR(pfs_param.m_file_sizing), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(-1, 1024 * 1024), DEFAULT(PFS_AUTOSCALE_VALUE), BLOCK_SIZE(1),
PFS_TRAILING_PROPERTIES);
static Sys_var_long Sys_pfs_max_sockets(
"performance_schema_max_socket_instances",
"Maximum number of opened instrumented sockets."
" Use 0 to disable, -1 for automated scaling.",
READ_ONLY GLOBAL_VAR(pfs_param.m_socket_sizing), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(-1, 1024 * 1024), DEFAULT(PFS_AUTOSCALE_VALUE), BLOCK_SIZE(1),
PFS_TRAILING_PROPERTIES);
static Sys_var_ulong Sys_pfs_max_socket_classes(
"performance_schema_max_socket_classes",
"Maximum number of socket instruments.",
READ_ONLY GLOBAL_VAR(pfs_param.m_socket_class_sizing),
CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 1024), DEFAULT(PFS_MAX_SOCKET_CLASS),
BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES);
static Sys_var_ulong Sys_pfs_max_mutex_classes(
"performance_schema_max_mutex_classes",
"Maximum number of mutex instruments.",
READ_ONLY GLOBAL_VAR(pfs_param.m_mutex_class_sizing),
CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 1024), DEFAULT(PFS_MAX_MUTEX_CLASS),
BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES);
static Sys_var_long Sys_pfs_max_mutex_instances(
"performance_schema_max_mutex_instances",
"Maximum number of instrumented MUTEX objects."
" Use 0 to disable, -1 for automated scaling.",
READ_ONLY GLOBAL_VAR(pfs_param.m_mutex_sizing), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(-1, 100 * 1024 * 1024), DEFAULT(PFS_AUTOSCALE_VALUE),
BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES);
static Sys_var_ulong Sys_pfs_max_rwlock_classes(
"performance_schema_max_rwlock_classes",
"Maximum number of rwlock instruments.",
READ_ONLY GLOBAL_VAR(pfs_param.m_rwlock_class_sizing),
CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 1024), DEFAULT(PFS_MAX_RWLOCK_CLASS),
BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES);
static Sys_var_long Sys_pfs_max_rwlock_instances(
"performance_schema_max_rwlock_instances",
"Maximum number of instrumented RWLOCK objects."
" Use 0 to disable, -1 for automated scaling.",
READ_ONLY GLOBAL_VAR(pfs_param.m_rwlock_sizing), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(-1, 100 * 1024 * 1024), DEFAULT(PFS_AUTOSCALE_VALUE),
BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES);
static Sys_var_long Sys_pfs_max_table_handles(
"performance_schema_max_table_handles",
"Maximum number of opened instrumented tables."
" Use 0 to disable, -1 for automated scaling.",
READ_ONLY GLOBAL_VAR(pfs_param.m_table_sizing), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(-1, 1024 * 1024), DEFAULT(PFS_AUTOSCALE_VALUE), BLOCK_SIZE(1),
PFS_TRAILING_PROPERTIES);
static Sys_var_long Sys_pfs_max_table_instances(
"performance_schema_max_table_instances",
"Maximum number of instrumented tables."
" Use 0 to disable, -1 for automated scaling.",
READ_ONLY GLOBAL_VAR(pfs_param.m_table_share_sizing),
CMD_LINE(REQUIRED_ARG), VALID_RANGE(-1, 1024 * 1024),
DEFAULT(PFS_AUTOSCALE_VALUE), BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES);
static Sys_var_long Sys_pfs_max_table_lock_stat(
"performance_schema_max_table_lock_stat",
"Maximum number of lock statistics for instrumented tables."
" Use 0 to disable, -1 for automated scaling.",
READ_ONLY GLOBAL_VAR(pfs_param.m_table_lock_stat_sizing),
CMD_LINE(REQUIRED_ARG), VALID_RANGE(-1, 1024 * 1024),
DEFAULT(PFS_AUTOSCALE_VALUE), BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES);
static Sys_var_long Sys_pfs_max_index_stat(
"performance_schema_max_index_stat",
"Maximum number of index statistics for instrumented tables."
" Use 0 to disable, -1 for automated scaling.",
READ_ONLY GLOBAL_VAR(pfs_param.m_index_stat_sizing), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(-1, 1024 * 1024), DEFAULT(PFS_AUTOSCALE_VALUE), BLOCK_SIZE(1),
PFS_TRAILING_PROPERTIES);
static Sys_var_ulong Sys_pfs_max_thread_classes(
"performance_schema_max_thread_classes",
"Maximum number of thread instruments.",
READ_ONLY GLOBAL_VAR(pfs_param.m_thread_class_sizing),
CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 1024), DEFAULT(PFS_MAX_THREAD_CLASS),
BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES);
static Sys_var_long Sys_pfs_max_thread_instances(
"performance_schema_max_thread_instances",
"Maximum number of instrumented threads."
" Use 0 to disable, -1 for automated scaling.",
READ_ONLY GLOBAL_VAR(pfs_param.m_thread_sizing), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(-1, 1024 * 1024), DEFAULT(PFS_AUTOSCALE_VALUE), BLOCK_SIZE(1),
PFS_TRAILING_PROPERTIES);
static Sys_var_long Sys_pfs_setup_actors_size(
"performance_schema_setup_actors_size",
"Maximum number of rows in SETUP_ACTORS."
" Use 0 to disable, -1 for automated scaling.",
READ_ONLY GLOBAL_VAR(pfs_param.m_setup_actor_sizing),
CMD_LINE(REQUIRED_ARG), VALID_RANGE(-1, 1024 * 1024),
DEFAULT(PFS_AUTOSCALE_VALUE), BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES);
static Sys_var_long Sys_pfs_setup_objects_size(
"performance_schema_setup_objects_size",
"Maximum number of rows in SETUP_OBJECTS."
" Use 0 to disable, -1 for automated scaling.",
READ_ONLY GLOBAL_VAR(pfs_param.m_setup_object_sizing),
CMD_LINE(REQUIRED_ARG), VALID_RANGE(-1, 1024 * 1024),
DEFAULT(PFS_AUTOSCALE_VALUE), BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES);
static Sys_var_long Sys_pfs_accounts_size(
"performance_schema_accounts_size",
"Maximum number of instrumented user@host accounts."
" Use 0 to disable, -1 for automated scaling.",
READ_ONLY GLOBAL_VAR(pfs_param.m_account_sizing), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(-1, 1024 * 1024), DEFAULT(PFS_AUTOSCALE_VALUE), BLOCK_SIZE(1),
PFS_TRAILING_PROPERTIES);
static Sys_var_long Sys_pfs_hosts_size(
"performance_schema_hosts_size",
"Maximum number of instrumented hosts."
" Use 0 to disable, -1 for automated scaling.",
READ_ONLY GLOBAL_VAR(pfs_param.m_host_sizing), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(-1, 1024 * 1024), DEFAULT(PFS_AUTOSCALE_VALUE), BLOCK_SIZE(1),
PFS_TRAILING_PROPERTIES);
static Sys_var_long Sys_pfs_users_size(
"performance_schema_users_size",
"Maximum number of instrumented users."
" Use 0 to disable, -1 for automated scaling.",
READ_ONLY GLOBAL_VAR(pfs_param.m_user_sizing), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(-1, 1024 * 1024), DEFAULT(PFS_AUTOSCALE_VALUE), BLOCK_SIZE(1),
PFS_TRAILING_PROPERTIES);
static Sys_var_ulong Sys_pfs_max_stage_classes(
"performance_schema_max_stage_classes",
"Maximum number of stage instruments.",
READ_ONLY GLOBAL_VAR(pfs_param.m_stage_class_sizing),
CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 1024), DEFAULT(PFS_MAX_STAGE_CLASS),
BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES);
static Sys_var_long Sys_pfs_events_stages_history_long_size(
"performance_schema_events_stages_history_long_size",
"Number of rows in EVENTS_STAGES_HISTORY_LONG."
" Use 0 to disable, -1 for automated sizing.",
READ_ONLY GLOBAL_VAR(pfs_param.m_events_stages_history_long_sizing),
CMD_LINE(REQUIRED_ARG), VALID_RANGE(-1, 1024 * 1024),
DEFAULT(PFS_AUTOSIZE_VALUE), BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES);
static Sys_var_long Sys_pfs_events_stages_history_size(
"performance_schema_events_stages_history_size",
"Number of rows per thread in EVENTS_STAGES_HISTORY."
" Use 0 to disable, -1 for automated sizing.",
READ_ONLY GLOBAL_VAR(pfs_param.m_events_stages_history_sizing),
CMD_LINE(REQUIRED_ARG), VALID_RANGE(-1, 1024), DEFAULT(PFS_AUTOSIZE_VALUE),
BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES);
/**
Variable performance_schema_max_statement_classes.
The default number of statement classes is the sum of:
- COM_END for all regular "statement/com/...",
- 1 for "statement/com/new_packet", for unknown enum_server_command
- 1 for "statement/com/Error", for invalid enum_server_command
- SQLCOM_END for all regular "statement/sql/...",
- 1 for "statement/sql/error", for invalid enum_sql_command.
- SP_PSI_STATEMENT_INFO_COUNT for "statement/sp/...".
- CLONE_PSI_STATEMENT_COUNT for "statement/clone/...".
- 1 for "statement/rpl/relay_log", for replicated statements.
- 1 for "statement/scheduler/event", for scheduled events.
- STMT_HANDLE_PSI_STATEMENT_INFO_COUNT for "statement/stmt_handle/...".
*/
static Sys_var_ulong Sys_pfs_max_statement_classes(
"performance_schema_max_statement_classes",
"Maximum number of statement instruments.",
READ_ONLY GLOBAL_VAR(pfs_param.m_statement_class_sizing),
CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 256),
DEFAULT((ulong)SQLCOM_END + (ulong)COM_END + 5 +
SP_PSI_STATEMENT_INFO_COUNT + CLONE_PSI_STATEMENT_COUNT +
STMT_HANDLE_PSI_STATEMENT_INFO_COUNT),
BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES);
static Sys_var_long Sys_pfs_events_statements_history_long_size(
"performance_schema_events_statements_history_long_size",
"Number of rows in EVENTS_STATEMENTS_HISTORY_LONG."
" Use 0 to disable, -1 for automated sizing.",
READ_ONLY GLOBAL_VAR(pfs_param.m_events_statements_history_long_sizing),
CMD_LINE(REQUIRED_ARG), VALID_RANGE(-1, 1024 * 1024),
DEFAULT(PFS_AUTOSIZE_VALUE), BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES);
static Sys_var_long Sys_pfs_events_statements_history_size(
"performance_schema_events_statements_history_size",
"Number of rows per thread in EVENTS_STATEMENTS_HISTORY."
" Use 0 to disable, -1 for automated sizing.",
READ_ONLY GLOBAL_VAR(pfs_param.m_events_statements_history_sizing),
CMD_LINE(REQUIRED_ARG), VALID_RANGE(-1, 1024), DEFAULT(PFS_AUTOSIZE_VALUE),
BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES);
static Sys_var_ulong Sys_pfs_statement_stack_size(
"performance_schema_max_statement_stack",
"Number of rows per thread in EVENTS_STATEMENTS_CURRENT.",
READ_ONLY GLOBAL_VAR(pfs_param.m_statement_stack_sizing),
CMD_LINE(REQUIRED_ARG), VALID_RANGE(1, 256),
DEFAULT(PFS_STATEMENTS_STACK_SIZE), BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES);
static Sys_var_ulong Sys_pfs_max_memory_classes(
"performance_schema_max_memory_classes",
"Maximum number of memory pool instruments.",
READ_ONLY GLOBAL_VAR(pfs_param.m_memory_class_sizing),
CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 1024), DEFAULT(PFS_MAX_MEMORY_CLASS),
BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES);
static Sys_var_ulong Sys_pfs_max_meter_classes(
"performance_schema_max_meter_classes",
"Maximum number of meter source instruments.",
READ_ONLY GLOBAL_VAR(pfs_param.m_meter_class_sizing),
CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 64), DEFAULT(PFS_MAX_METER_CLASS),
BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES);
static Sys_var_ulong Sys_pfs_max_metric_classes(
"performance_schema_max_metric_classes",
"Maximum number of metric source instruments.",
READ_ONLY GLOBAL_VAR(pfs_param.m_metric_class_sizing),
CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 11000),
DEFAULT(PFS_MAX_METRIC_CLASS), BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES);
static Sys_var_ulong Sys_pfs_max_logger_classes(
"performance_schema_max_logger_classes",
"Maximum number of logger source instruments.",
READ_ONLY GLOBAL_VAR(pfs_param.m_logger_class_sizing),
CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 200), DEFAULT(PFS_MAX_LOGGER_CLASS),
BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES);
static Sys_var_long Sys_pfs_digest_size(
"performance_schema_digests_size",
"Size of the statement digest."
" Use 0 to disable, -1 for automated sizing.",
READ_ONLY GLOBAL_VAR(pfs_param.m_digest_sizing), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(-1, 1024 * 1024), DEFAULT(PFS_AUTOSIZE_VALUE), BLOCK_SIZE(1),