github.com/whtcorpsinc/milevadb-prod@v0.0.0-20211104133533-f57f4be3b597/causetstore/stochastikctx/variable/sysvar.go (about)

     1  // Copyright 2020 WHTCORPS INC, Inc.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // See the License for the specific language governing permissions and
    12  // limitations under the License.
    13  
    14  package variable
    15  
    16  import (
    17  	"strconv"
    18  	"strings"
    19  	"sync/atomic"
    20  
    21  	"github.com/whtcorpsinc/BerolinaSQL/allegrosql"
    22  	"github.com/whtcorpsinc/milevadb/config"
    23  	"github.com/whtcorpsinc/milevadb/ekv"
    24  	"github.com/whtcorpsinc/milevadb/soliton/logutil"
    25  	"github.com/whtcorpsinc/milevadb/soliton/versioninfo"
    26  )
    27  
    28  // ScopeFlag is for system variable whether can be changed in global/stochastik dynamically or not.
    29  type ScopeFlag uint8
    30  
    31  const (
    32  	// ScopeNone means the system variable can not be changed dynamically.
    33  	ScopeNone ScopeFlag = 0
    34  	// ScopeGlobal means the system variable can be changed globally.
    35  	ScopeGlobal ScopeFlag = 1 << 0
    36  	// ScopeStochastik means the system variable can only be changed in current stochastik.
    37  	ScopeStochastik ScopeFlag = 1 << 1
    38  )
    39  
    40  // SysVar is for system variable.
    41  type SysVar struct {
    42  	// Scope is for whether can be changed or not
    43  	Scope ScopeFlag
    44  
    45  	// Name is the variable name.
    46  	Name string
    47  
    48  	// Value is the variable value.
    49  	Value string
    50  }
    51  
    52  // SysVars is global sys vars map.
    53  var SysVars map[string]*SysVar
    54  
    55  // GetSysVar returns sys var info for name as key.
    56  func GetSysVar(name string) *SysVar {
    57  	name = strings.ToLower(name)
    58  	return SysVars[name]
    59  }
    60  
    61  // PluginVarNames is global plugin var names set.
    62  var PluginVarNames []string
    63  
    64  func init() {
    65  	SysVars = make(map[string]*SysVar)
    66  	for _, v := range defaultSysVars {
    67  		SysVars[v.Name] = v
    68  	}
    69  	initSynonymsSysVariables()
    70  }
    71  
    72  // BoolToIntStr converts bool to int string, for example "0" or "1".
    73  func BoolToIntStr(b bool) string {
    74  	if b {
    75  		return "1"
    76  	}
    77  	return "0"
    78  }
    79  
    80  func boolToOnOff(b bool) string {
    81  	if b {
    82  		return "on"
    83  	}
    84  	return "off"
    85  }
    86  
    87  // BoolToInt32 converts bool to int32
    88  func BoolToInt32(b bool) int32 {
    89  	if b {
    90  		return 1
    91  	}
    92  	return 0
    93  }
    94  
    95  // we only support MyALLEGROSQL now
    96  var defaultSysVars = []*SysVar{
    97  	{ScopeGlobal, "gtid_mode", "OFF"},
    98  	{ScopeGlobal, FlushTime, "0"},
    99  	{ScopeNone, "performance_schema_max_mutex_classes", "200"},
   100  	{ScopeGlobal | ScopeStochastik, LowPriorityUFIDelates, "0"},
   101  	{ScopeGlobal | ScopeStochastik, StochastikTrackGtids, "OFF"},
   102  	{ScopeGlobal | ScopeStochastik, "ndbinfo_max_rows", ""},
   103  	{ScopeGlobal | ScopeStochastik, "ndb_index_stat_option", ""},
   104  	{ScopeGlobal | ScopeStochastik, OldPasswords, "0"},
   105  	{ScopeNone, "innodb_version", "5.6.25"},
   106  	{ScopeGlobal, MaxConnections, "151"},
   107  	{ScopeGlobal | ScopeStochastik, BigBlocks, "0"},
   108  	{ScopeNone, "skip_external_locking", "1"},
   109  	{ScopeNone, "innodb_sync_array_size", "1"},
   110  	{ScopeStochastik, "rand_seed2", ""},
   111  	{ScopeGlobal, ValidatePasswordCheckUserName, "0"},
   112  	{ScopeGlobal, "validate_password_number_count", "1"},
   113  	{ScopeStochastik, "gtid_next", ""},
   114  	{ScopeGlobal | ScopeStochastik, ALLEGROSQLSelectLimit, "18446744073709551615"},
   115  	{ScopeGlobal, "ndb_show_foreign_key_mock_blocks", ""},
   116  	{ScopeNone, "multi_range_count", "256"},
   117  	{ScopeGlobal | ScopeStochastik, DefaultWeekFormat, "0"},
   118  	{ScopeGlobal | ScopeStochastik, "binlog_error_action", "IGNORE_ERROR"},
   119  	{ScopeGlobal | ScopeStochastik, "default_storage_engine", "InnoDB"},
   120  	{ScopeNone, "ft_query_expansion_limit", "20"},
   121  	{ScopeGlobal, MaxConnectErrors, "100"},
   122  	{ScopeGlobal, SyncBinlog, "0"},
   123  	{ScopeNone, "max_digest_length", "1024"},
   124  	{ScopeNone, "innodb_force_load_corrupted", "0"},
   125  	{ScopeNone, "performance_schema_max_block_handles", "4000"},
   126  	{ScopeGlobal, InnodbFastShutdown, "1"},
   127  	{ScopeNone, "ft_max_word_len", "84"},
   128  	{ScopeGlobal, "log_backward_compatible_user_definitions", ""},
   129  	{ScopeNone, "lc_messages_dir", "/usr/local/allegrosql-5.6.25-osx10.8-x86_64/share/"},
   130  	{ScopeGlobal, "ft_boolean_syntax", "+ -><()~*:\"\"&|"},
   131  	{ScopeGlobal, BlockDefinitionCache, "-1"},
   132  	{ScopeNone, SkipNameResolve, "0"},
   133  	{ScopeNone, "performance_schema_max_file_handles", "32768"},
   134  	{ScopeStochastik, "transaction_allow_batching", ""},
   135  	{ScopeGlobal | ScopeStochastik, ALLEGROSQLModeVar, allegrosql.DefaultALLEGROSQLMode},
   136  	{ScopeNone, "performance_schema_max_memex_classes", "168"},
   137  	{ScopeGlobal, "server_id", "0"},
   138  	{ScopeGlobal, "innodb_flushing_avg_loops", "30"},
   139  	{ScopeGlobal | ScopeStochastik, TmpBlockSize, "16777216"},
   140  	{ScopeGlobal, "innodb_max_purge_lag", "0"},
   141  	{ScopeGlobal | ScopeStochastik, "preload_buffer_size", "32768"},
   142  	{ScopeGlobal, CheckProxyUsers, "0"},
   143  	{ScopeNone, "have_query_cache", "YES"},
   144  	{ScopeGlobal, "innodb_flush_log_at_timeout", "1"},
   145  	{ScopeGlobal, "innodb_max_undo_log_size", ""},
   146  	{ScopeGlobal | ScopeStochastik, "range_alloc_block_size", "4096"},
   147  	{ScopeGlobal, ConnectTimeout, "10"},
   148  	{ScopeGlobal | ScopeStochastik, MaxInterDircutionTime, "0"},
   149  	{ScopeGlobal | ScopeStochastik, DefCauslationServer, allegrosql.DefaultDefCauslationName},
   150  	{ScopeNone, "have_rtree_keys", "YES"},
   151  	{ScopeGlobal, "innodb_old_blocks_pct", "37"},
   152  	{ScopeGlobal, "innodb_file_format", "Antelope"},
   153  	{ScopeGlobal, "innodb_compression_failure_threshold_pct", "5"},
   154  	{ScopeNone, "performance_schema_events_waits_history_long_size", "10000"},
   155  	{ScopeGlobal, "innodb_checksum_algorithm", "innodb"},
   156  	{ScopeNone, "innodb_ft_sort_pll_degree", "2"},
   157  	{ScopeNone, "thread_stack", "262144"},
   158  	{ScopeGlobal, "relay_log_info_repository", "FILE"},
   159  	{ScopeGlobal | ScopeStochastik, ALLEGROSQLLogBin, "1"},
   160  	{ScopeGlobal, SuperReadOnly, "0"},
   161  	{ScopeGlobal | ScopeStochastik, "max_delayed_threads", "20"},
   162  	{ScopeNone, "protodefCaus_version", "10"},
   163  	{ScopeGlobal | ScopeStochastik, "new", "OFF"},
   164  	{ScopeGlobal | ScopeStochastik, "myisam_sort_buffer_size", "8388608"},
   165  	{ScopeGlobal | ScopeStochastik, "optimizer_trace_offset", "-1"},
   166  	{ScopeGlobal, InnodbBufferPoolDumpAtShutdown, "0"},
   167  	{ScopeGlobal | ScopeStochastik, ALLEGROSQLNotes, "1"},
   168  	{ScopeGlobal, InnodbCmpPerIndexEnabled, "0"},
   169  	{ScopeGlobal, "innodb_ft_server_stopword_block", ""},
   170  	{ScopeNone, "performance_schema_max_file_instances", "7693"},
   171  	{ScopeNone, "log_output", "FILE"},
   172  	{ScopeGlobal, "binlog_group_commit_sync_delay", ""},
   173  	{ScopeGlobal, "binlog_group_commit_sync_no_delay_count", ""},
   174  	{ScopeNone, "have_crypt", "YES"},
   175  	{ScopeGlobal, "innodb_log_write_ahead_size", ""},
   176  	{ScopeNone, "innodb_log_group_home_dir", "./"},
   177  	{ScopeNone, "performance_schema_events_memexs_history_size", "10"},
   178  	{ScopeGlobal, GeneralLog, "0"},
   179  	{ScopeGlobal, "validate_password_dictionary_file", ""},
   180  	{ScopeGlobal, BinlogOrderCommits, "1"},
   181  	{ScopeGlobal, "key_cache_division_limit", "100"},
   182  	{ScopeGlobal | ScopeStochastik, "max_insert_delayed_threads", "20"},
   183  	{ScopeNone, "performance_schema_stochastik_connect_attrs_size", "512"},
   184  	{ScopeGlobal | ScopeStochastik, "time_zone", "SYSTEM"},
   185  	{ScopeGlobal, "innodb_max_dirty_pages_pct", "75"},
   186  	{ScopeGlobal, InnodbFilePerBlock, "1"},
   187  	{ScopeGlobal, InnodbLogCompressedPages, "1"},
   188  	{ScopeNone, "skip_networking", "0"},
   189  	{ScopeGlobal, "innodb_monitor_reset", ""},
   190  	{ScopeNone, "have_ssl", "DISABLED"},
   191  	{ScopeNone, "have_openssl", "DISABLED"},
   192  	{ScopeNone, "ssl_ca", ""},
   193  	{ScopeNone, "ssl_cert", ""},
   194  	{ScopeNone, "ssl_key", ""},
   195  	{ScopeNone, "ssl_cipher", ""},
   196  	{ScopeNone, "tls_version", "TLSv1,TLSv1.1,TLSv1.2"},
   197  	{ScopeNone, "system_time_zone", "CST"},
   198  	{ScopeGlobal, InnodbPrintAllDeadlocks, "0"},
   199  	{ScopeNone, "innodb_autoinc_lock_mode", "1"},
   200  	{ScopeGlobal, "key_buffer_size", "8388608"},
   201  	{ScopeGlobal | ScopeStochastik, ForeignKeyChecks, "OFF"},
   202  	{ScopeGlobal, "host_cache_size", "279"},
   203  	{ScopeGlobal, DelayKeyWrite, "ON"},
   204  	{ScopeNone, "spacetimedata_locks_cache_size", "1024"},
   205  	{ScopeNone, "innodb_force_recovery", "0"},
   206  	{ScopeGlobal, "innodb_file_format_max", "Antelope"},
   207  	{ScopeGlobal | ScopeStochastik, "debug", ""},
   208  	{ScopeGlobal, "log_warnings", "1"},
   209  	{ScopeGlobal, OfflineMode, "0"},
   210  	{ScopeGlobal | ScopeStochastik, InnodbStrictMode, "1"},
   211  	{ScopeGlobal, "innodb_rollback_segments", "128"},
   212  	{ScopeGlobal | ScopeStochastik, "join_buffer_size", "262144"},
   213  	{ScopeNone, "innodb_mirrored_log_groups", "1"},
   214  	{ScopeGlobal, "max_binlog_size", "1073741824"},
   215  	{ScopeGlobal, "concurrent_insert", "AUTO"},
   216  	{ScopeGlobal, InnodbAdaptiveHashIndex, "1"},
   217  	{ScopeGlobal, InnodbFtEnableStopword, "1"},
   218  	{ScopeGlobal, "general_log_file", "/usr/local/allegrosql/data/localhost.log"},
   219  	{ScopeGlobal | ScopeStochastik, InnodbSupportXA, "1"},
   220  	{ScopeGlobal, "innodb_compression_level", "6"},
   221  	{ScopeNone, "innodb_file_format_check", "1"},
   222  	{ScopeNone, "myisam_mmap_size", "18446744073709551615"},
   223  	{ScopeNone, "innodb_buffer_pool_instances", "8"},
   224  	{ScopeGlobal | ScopeStochastik, BlockEncryptionMode, "aes-128-ecb"},
   225  	{ScopeGlobal | ScopeStochastik, "max_length_for_sort_data", "1024"},
   226  	{ScopeNone, "character_set_system", "utf8"},
   227  	{ScopeGlobal | ScopeStochastik, InteractiveTimeout, "28800"},
   228  	{ScopeGlobal, InnodbOptimizeFullTextOnly, "0"},
   229  	{ScopeNone, "character_sets_dir", "/usr/local/allegrosql-5.6.25-osx10.8-x86_64/share/charsets/"},
   230  	{ScopeGlobal | ScopeStochastik, QueryCacheType, "OFF"},
   231  	{ScopeNone, "innodb_rollback_on_timeout", "0"},
   232  	{ScopeGlobal | ScopeStochastik, "query_alloc_block_size", "8192"},
   233  	{ScopeGlobal | ScopeStochastik, InitConnect, ""},
   234  	{ScopeNone, "have_compress", "YES"},
   235  	{ScopeNone, "thread_concurrency", "10"},
   236  	{ScopeGlobal | ScopeStochastik, "query_prealloc_size", "8192"},
   237  	{ScopeNone, "relay_log_space_limit", "0"},
   238  	{ScopeGlobal | ScopeStochastik, MaxUserConnections, "0"},
   239  	{ScopeNone, "performance_schema_max_thread_classes", "50"},
   240  	{ScopeGlobal, "innodb_api_trx_level", "0"},
   241  	{ScopeNone, "disconnect_on_expired_password", "1"},
   242  	{ScopeNone, "performance_schema_max_file_classes", "50"},
   243  	{ScopeGlobal, "expire_logs_days", "0"},
   244  	{ScopeGlobal | ScopeStochastik, BinlogRowQueryLogEvents, "0"},
   245  	{ScopeGlobal, "default_password_lifetime", ""},
   246  	{ScopeNone, "pid_file", "/usr/local/allegrosql/data/localhost.pid"},
   247  	{ScopeNone, "innodb_undo_blockspaces", "0"},
   248  	{ScopeGlobal, InnodbStatusOutputLocks, "0"},
   249  	{ScopeNone, "performance_schema_accounts_size", "100"},
   250  	{ScopeGlobal | ScopeStochastik, "max_error_count", "64"},
   251  	{ScopeGlobal, "max_write_lock_count", "18446744073709551615"},
   252  	{ScopeNone, "performance_schema_max_socket_instances", "322"},
   253  	{ScopeNone, "performance_schema_max_block_instances", "12500"},
   254  	{ScopeGlobal, "innodb_stats_persistent_sample_pages", "20"},
   255  	{ScopeGlobal, "show_compatibility_56", ""},
   256  	{ScopeNone, "innodb_open_files", "2000"},
   257  	{ScopeGlobal, "innodb_spin_wait_delay", "6"},
   258  	{ScopeGlobal, "thread_cache_size", "9"},
   259  	{ScopeGlobal, LogSlowAdminStatements, "0"},
   260  	{ScopeNone, "innodb_checksums", "ON"},
   261  	{ScopeNone, "hostname", ServerHostname},
   262  	{ScopeGlobal | ScopeStochastik, "auto_increment_offset", "1"},
   263  	{ScopeNone, "ft_stopword_file", "(built-in)"},
   264  	{ScopeGlobal, "innodb_max_dirty_pages_pct_lwm", "0"},
   265  	{ScopeGlobal, LogQueriesNotUsingIndexes, "0"},
   266  	{ScopeStochastik, "timestamp", ""},
   267  	{ScopeGlobal | ScopeStochastik, QueryCacheWlockInvalidate, "0"},
   268  	{ScopeGlobal | ScopeStochastik, "sql_buffer_result", "OFF"},
   269  	{ScopeGlobal | ScopeStochastik, "character_set_filesystem", "binary"},
   270  	{ScopeGlobal | ScopeStochastik, "defCauslation_database", allegrosql.DefaultDefCauslationName},
   271  	{ScopeGlobal | ScopeStochastik, AutoIncrementIncrement, strconv.FormatInt(DefAutoIncrementIncrement, 10)},
   272  	{ScopeGlobal | ScopeStochastik, AutoIncrementOffset, strconv.FormatInt(DefAutoIncrementOffset, 10)},
   273  	{ScopeGlobal | ScopeStochastik, "max_heap_block_size", "16777216"},
   274  	{ScopeGlobal | ScopeStochastik, "div_precision_increment", "4"},
   275  	{ScopeGlobal, "innodb_lru_scan_depth", "1024"},
   276  	{ScopeGlobal, "innodb_purge_rseg_truncate_frequency", ""},
   277  	{ScopeGlobal | ScopeStochastik, ALLEGROSQLAutoIsNull, "0"},
   278  	{ScopeNone, "innodb_api_enable_binlog", "0"},
   279  	{ScopeGlobal | ScopeStochastik, "innodb_ft_user_stopword_block", ""},
   280  	{ScopeNone, "server_id_bits", "32"},
   281  	{ScopeGlobal, "innodb_log_checksum_algorithm", ""},
   282  	{ScopeNone, "innodb_buffer_pool_load_at_startup", "1"},
   283  	{ScopeGlobal | ScopeStochastik, "sort_buffer_size", "262144"},
   284  	{ScopeGlobal, "innodb_flush_neighbors", "1"},
   285  	{ScopeNone, "innodb_use_sys_malloc", "1"},
   286  	{ScopeStochastik, PluginLoad, ""},
   287  	{ScopeStochastik, PluginDir, "/data/deploy/plugin"},
   288  	{ScopeNone, "performance_schema_max_socket_classes", "10"},
   289  	{ScopeNone, "performance_schema_max_stage_classes", "150"},
   290  	{ScopeGlobal, "innodb_purge_batch_size", "300"},
   291  	{ScopeNone, "have_profiling", "NO"},
   292  	{ScopeGlobal | ScopeStochastik, "character_set_client", allegrosql.DefaultCharset},
   293  	{ScopeGlobal, InnodbBufferPoolDumpNow, "0"},
   294  	{ScopeGlobal, RelayLogPurge, "1"},
   295  	{ScopeGlobal, "ndb_distribution", ""},
   296  	{ScopeGlobal, "myisam_data_pointer_size", "6"},
   297  	{ScopeGlobal, "ndb_optimization_delay", ""},
   298  	{ScopeGlobal, "innodb_ft_num_word_optimize", "2000"},
   299  	{ScopeGlobal | ScopeStochastik, "max_join_size", "18446744073709551615"},
   300  	{ScopeNone, CoreFile, "0"},
   301  	{ScopeGlobal | ScopeStochastik, "max_seeks_for_key", "18446744073709551615"},
   302  	{ScopeNone, "innodb_log_buffer_size", "8388608"},
   303  	{ScopeGlobal, "delayed_insert_timeout", "300"},
   304  	{ScopeGlobal, "max_relay_log_size", "0"},
   305  	{ScopeGlobal | ScopeStochastik, MaxSortLength, "1024"},
   306  	{ScopeNone, "spacetimedata_locks_hash_instances", "8"},
   307  	{ScopeGlobal, "ndb_eventbuffer_free_percent", ""},
   308  	{ScopeNone, "large_files_support", "1"},
   309  	{ScopeGlobal, "binlog_max_flush_queue_time", "0"},
   310  	{ScopeGlobal, "innodb_fill_factor", ""},
   311  	{ScopeGlobal, "log_syslog_facility", ""},
   312  	{ScopeNone, "innodb_ft_min_token_size", "3"},
   313  	{ScopeGlobal | ScopeStochastik, "transaction_write_set_extraction", ""},
   314  	{ScopeGlobal | ScopeStochastik, "ndb_blob_write_batch_bytes", ""},
   315  	{ScopeGlobal, "automatic_sp_privileges", "1"},
   316  	{ScopeGlobal, "innodb_flush_sync", ""},
   317  	{ScopeNone, "performance_schema_events_memexs_history_long_size", "10000"},
   318  	{ScopeGlobal, "innodb_monitor_disable", ""},
   319  	{ScopeNone, "innodb_doublewrite", "1"},
   320  	{ScopeNone, "log_bin_use_v1_row_events", "0"},
   321  	{ScopeStochastik, "innodb_optimize_point_storage", ""},
   322  	{ScopeNone, "innodb_api_disable_rowlock", "0"},
   323  	{ScopeGlobal, "innodb_adaptive_flushing_lwm", "10"},
   324  	{ScopeNone, "innodb_log_files_in_group", "2"},
   325  	{ScopeGlobal, InnodbBufferPoolLoadNow, "0"},
   326  	{ScopeNone, "performance_schema_max_rwlock_classes", "40"},
   327  	{ScopeNone, "binlog_gtid_simple_recovery", "1"},
   328  	{ScopeNone, Port, "4000"},
   329  	{ScopeNone, "performance_schema_digests_size", "10000"},
   330  	{ScopeGlobal | ScopeStochastik, Profiling, "0"},
   331  	{ScopeNone, "lower_case_block_names", "2"},
   332  	{ScopeStochastik, "rand_seed1", ""},
   333  	{ScopeGlobal, "sha256_password_proxy_users", ""},
   334  	{ScopeGlobal | ScopeStochastik, ALLEGROSQLQuoteShowCreate, "1"},
   335  	{ScopeGlobal | ScopeStochastik, "binlogging_impossible_mode", "IGNORE_ERROR"},
   336  	{ScopeGlobal | ScopeStochastik, QueryCacheSize, "1048576"},
   337  	{ScopeGlobal, "innodb_stats_transient_sample_pages", "8"},
   338  	{ScopeGlobal, InnodbStatsOnMetadata, "0"},
   339  	{ScopeNone, "server_uuid", "00000000-0000-0000-0000-000000000000"},
   340  	{ScopeNone, "open_files_limit", "5000"},
   341  	{ScopeGlobal | ScopeStochastik, "ndb_force_send", ""},
   342  	{ScopeNone, "skip_show_database", "0"},
   343  	{ScopeGlobal, "log_timestamps", ""},
   344  	{ScopeNone, "version_compile_machine", "x86_64"},
   345  	{ScopeGlobal, "event_scheduler", "OFF"},
   346  	{ScopeGlobal | ScopeStochastik, "ndb_deferred_constraints", ""},
   347  	{ScopeGlobal, "log_syslog_include_pid", ""},
   348  	{ScopeStochastik, "last_insert_id", ""},
   349  	{ScopeNone, "innodb_ft_cache_size", "8000000"},
   350  	{ScopeNone, LogBin, "0"},
   351  	{ScopeGlobal, InnodbDisableSortFileCache, "0"},
   352  	{ScopeGlobal, "log_error_verbosity", ""},
   353  	{ScopeNone, "performance_schema_hosts_size", "100"},
   354  	{ScopeGlobal, "innodb_replication_delay", "0"},
   355  	{ScopeGlobal, SlowQueryLog, "0"},
   356  	{ScopeStochastik, "debug_sync", ""},
   357  	{ScopeGlobal, InnodbStatsAutoRecalc, "1"},
   358  	{ScopeGlobal | ScopeStochastik, "lc_messages", "en_US"},
   359  	{ScopeGlobal | ScopeStochastik, "bulk_insert_buffer_size", "8388608"},
   360  	{ScopeGlobal | ScopeStochastik, BinlogDirectNonTransactionalUFIDelates, "0"},
   361  	{ScopeGlobal, "innodb_change_buffering", "all"},
   362  	{ScopeGlobal | ScopeStochastik, ALLEGROSQLBigSelects, "1"},
   363  	{ScopeGlobal | ScopeStochastik, CharacterSetResults, allegrosql.DefaultCharset},
   364  	{ScopeGlobal, "innodb_max_purge_lag_delay", "0"},
   365  	{ScopeGlobal | ScopeStochastik, "stochastik_track_schema", ""},
   366  	{ScopeGlobal, "innodb_io_capacity_max", "2000"},
   367  	{ScopeGlobal, "innodb_autoextend_increment", "64"},
   368  	{ScopeGlobal | ScopeStochastik, "binlog_format", "STATEMENT"},
   369  	{ScopeGlobal | ScopeStochastik, "optimizer_trace", "enabled=off,one_line=off"},
   370  	{ScopeGlobal | ScopeStochastik, "read_rnd_buffer_size", "262144"},
   371  	{ScopeNone, "version_comment", "MilevaDB Server (Apache License 2.0) " + versioninfo.MilevaDBEdition + " Edition, MyALLEGROSQL 5.7 compatible"},
   372  	{ScopeGlobal | ScopeStochastik, NetWriteTimeout, "60"},
   373  	{ScopeGlobal, InnodbBufferPoolLoadAbort, "0"},
   374  	{ScopeGlobal | ScopeStochastik, TxnIsolation, "REPEATABLE-READ"},
   375  	{ScopeGlobal | ScopeStochastik, TransactionIsolation, "REPEATABLE-READ"},
   376  	{ScopeGlobal | ScopeStochastik, "defCauslation_connection", allegrosql.DefaultDefCauslationName},
   377  	{ScopeGlobal | ScopeStochastik, "transaction_prealloc_size", "4096"},
   378  	{ScopeNone, "performance_schema_setup_objects_size", "100"},
   379  	{ScopeGlobal, "sync_relay_log", "10000"},
   380  	{ScopeGlobal, "innodb_ft_result_cache_limit", "2000000000"},
   381  	{ScopeNone, "innodb_sort_buffer_size", "1048576"},
   382  	{ScopeGlobal, "innodb_ft_enable_diag_print", "OFF"},
   383  	{ScopeNone, "thread_handling", "one-thread-per-connection"},
   384  	{ScopeGlobal, "stored_program_cache", "256"},
   385  	{ScopeNone, "performance_schema_max_mutex_instances", "15906"},
   386  	{ScopeGlobal, "innodb_adaptive_max_sleep_delay", "150000"},
   387  	{ScopeNone, "large_pages", "OFF"},
   388  	{ScopeGlobal | ScopeStochastik, "stochastik_track_system_variables", ""},
   389  	{ScopeGlobal, "innodb_change_buffer_max_size", "25"},
   390  	{ScopeGlobal, LogBinTrustFunctionCreators, "0"},
   391  	{ScopeNone, "innodb_write_io_threads", "4"},
   392  	{ScopeGlobal, "mysql_native_password_proxy_users", ""},
   393  	{ScopeGlobal, serverReadOnly, "0"},
   394  	{ScopeNone, "large_page_size", "0"},
   395  	{ScopeNone, "block_open_cache_instances", "1"},
   396  	{ScopeGlobal, InnodbStatsPersistent, "1"},
   397  	{ScopeGlobal | ScopeStochastik, "stochastik_track_state_change", ""},
   398  	{ScopeNone, "optimizer_switch", "index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,mrr=on,mrr_cost_based=on,block_nested_loop=on,batched_key_access=off,materialization=on,semijoin=on,loosescan=on,firstmatch=on,subquery_materialization_cost_based=on,use_index_extensions=on"},
   399  	{ScopeGlobal, "delayed_queue_size", "1000"},
   400  	{ScopeNone, "innodb_read_only", "0"},
   401  	{ScopeNone, "datetime_format", "%Y-%m-%d %H:%i:%s"},
   402  	{ScopeGlobal, "log_syslog", ""},
   403  	{ScopeNone, "version", allegrosql.ServerVersion},
   404  	{ScopeGlobal | ScopeStochastik, "transaction_alloc_block_size", "8192"},
   405  	{ScopeGlobal, "innodb_large_prefix", "OFF"},
   406  	{ScopeNone, "performance_schema_max_cond_classes", "80"},
   407  	{ScopeGlobal, "innodb_io_capacity", "200"},
   408  	{ScopeGlobal, "max_binlog_cache_size", "18446744073709547520"},
   409  	{ScopeGlobal | ScopeStochastik, "ndb_index_stat_enable", ""},
   410  	{ScopeGlobal, "executed_gtids_compression_period", ""},
   411  	{ScopeNone, "time_format", "%H:%i:%s"},
   412  	{ScopeGlobal | ScopeStochastik, OldAlterBlock, "0"},
   413  	{ScopeGlobal | ScopeStochastik, "long_query_time", "10.000000"},
   414  	{ScopeNone, "innodb_use_native_aio", "0"},
   415  	{ScopeGlobal, "log_throttle_queries_not_using_indexes", "0"},
   416  	{ScopeNone, "locked_in_memory", "0"},
   417  	{ScopeNone, "innodb_api_enable_mdl", "0"},
   418  	{ScopeGlobal, "binlog_cache_size", "32768"},
   419  	{ScopeGlobal, "innodb_compression_pad_pct_max", "50"},
   420  	{ScopeGlobal, InnodbCommitConcurrency, "0"},
   421  	{ScopeNone, "ft_min_word_len", "4"},
   422  	{ScopeGlobal, EnforceGtidConsistency, "OFF"},
   423  	{ScopeGlobal, SecureAuth, "1"},
   424  	{ScopeNone, "max_tmp_blocks", "32"},
   425  	{ScopeGlobal, InnodbRandomReadAhead, "0"},
   426  	{ScopeGlobal | ScopeStochastik, UniqueChecks, "1"},
   427  	{ScopeGlobal, "internal_tmp_disk_storage_engine", ""},
   428  	{ScopeGlobal | ScopeStochastik, "myisam_repair_threads", "1"},
   429  	{ScopeGlobal, "ndb_eventbuffer_max_alloc", ""},
   430  	{ScopeGlobal, "innodb_read_ahead_threshold", "56"},
   431  	{ScopeGlobal, "key_cache_block_size", "1024"},
   432  	{ScopeNone, "ndb_recv_thread_cpu_mask", ""},
   433  	{ScopeGlobal, "gtid_purged", ""},
   434  	{ScopeGlobal, "max_binlog_stmt_cache_size", "18446744073709547520"},
   435  	{ScopeGlobal | ScopeStochastik, "lock_wait_timeout", "31536000"},
   436  	{ScopeGlobal | ScopeStochastik, "read_buffer_size", "131072"},
   437  	{ScopeNone, "innodb_read_io_threads", "4"},
   438  	{ScopeGlobal | ScopeStochastik, MaxSpRecursionDepth, "0"},
   439  	{ScopeNone, "ignore_builtin_innodb", "0"},
   440  	{ScopeGlobal, "slow_query_log_file", "/usr/local/allegrosql/data/localhost-slow.log"},
   441  	{ScopeGlobal, "innodb_thread_sleep_delay", "10000"},
   442  	{ScopeNone, "license", "Apache License 2.0"},
   443  	{ScopeGlobal, "innodb_ft_aux_block", ""},
   444  	{ScopeGlobal | ScopeStochastik, ALLEGROSQLWarnings, "0"},
   445  	{ScopeGlobal | ScopeStochastik, KeepFilesOnCreate, "0"},
   446  	{ScopeNone, "innodb_data_file_path", "ibdata1:12M:autoextend"},
   447  	{ScopeNone, "performance_schema_setup_actors_size", "100"},
   448  	{ScopeNone, "innodb_additional_mem_pool_size", "8388608"},
   449  	{ScopeNone, "log_error", "/usr/local/allegrosql/data/localhost.err"},
   450  	{ScopeGlobal, "binlog_stmt_cache_size", "32768"},
   451  	{ScopeNone, "relay_log_info_file", "relay-log.info"},
   452  	{ScopeNone, "innodb_ft_total_cache_size", "640000000"},
   453  	{ScopeNone, "performance_schema_max_rwlock_instances", "9102"},
   454  	{ScopeGlobal, "block_open_cache", "2000"},
   455  	{ScopeNone, "performance_schema_events_stages_history_long_size", "10000"},
   456  	{ScopeGlobal | ScopeStochastik, AutoCommit, "1"},
   457  	{ScopeStochastik, "insert_id", ""},
   458  	{ScopeGlobal | ScopeStochastik, "default_tmp_storage_engine", "InnoDB"},
   459  	{ScopeGlobal | ScopeStochastik, "optimizer_search_depth", "62"},
   460  	{ScopeGlobal, "max_points_in_geometry", ""},
   461  	{ScopeGlobal, "innodb_stats_sample_pages", "8"},
   462  	{ScopeGlobal | ScopeStochastik, "profiling_history_size", "15"},
   463  	{ScopeGlobal | ScopeStochastik, "character_set_database", allegrosql.DefaultCharset},
   464  	{ScopeNone, "have_symlink", "YES"},
   465  	{ScopeGlobal | ScopeStochastik, "storage_engine", "InnoDB"},
   466  	{ScopeGlobal | ScopeStochastik, "sql_log_off", "0"},
   467  	// In MyALLEGROSQL, the default value of `explicit_defaults_for_timestamp` is `0`.
   468  	// But In MilevaDB, it's set to `1` to be consistent with MilevaDB timestamp behavior.
   469  	// See: https://github.com/whtcorpsinc/milevadb/pull/6068 for details
   470  	{ScopeNone, "explicit_defaults_for_timestamp", "1"},
   471  	{ScopeNone, "performance_schema_events_waits_history_size", "10"},
   472  	{ScopeGlobal, "log_syslog_tag", ""},
   473  	{ScopeGlobal | ScopeStochastik, TxReadOnly, "0"},
   474  	{ScopeGlobal | ScopeStochastik, TransactionReadOnly, "0"},
   475  	{ScopeGlobal, "innodb_undo_log_truncate", ""},
   476  	{ScopeStochastik, "innodb_create_intrinsic", ""},
   477  	{ScopeGlobal, "gtid_executed_compression_period", ""},
   478  	{ScopeGlobal, "ndb_log_empty_epochs", ""},
   479  	{ScopeGlobal, MaxPreparedStmtCount, strconv.FormatInt(DefMaxPreparedStmtCount, 10)},
   480  	{ScopeNone, "have_geometry", "YES"},
   481  	{ScopeGlobal | ScopeStochastik, "optimizer_trace_max_mem_size", "16384"},
   482  	{ScopeGlobal | ScopeStochastik, "net_retry_count", "10"},
   483  	{ScopeStochastik, "ndb_block_no_logging", ""},
   484  	{ScopeGlobal | ScopeStochastik, "optimizer_trace_features", "greedy_search=on,range_optimizer=on,dynamic_range=on,repeated_subselect=on"},
   485  	{ScopeGlobal, "innodb_flush_log_at_trx_commit", "1"},
   486  	{ScopeGlobal, "rewriter_enabled", ""},
   487  	{ScopeGlobal, "query_cache_min_res_unit", "4096"},
   488  	{ScopeGlobal | ScopeStochastik, "uFIDelablock_views_with_limit", "YES"},
   489  	{ScopeGlobal | ScopeStochastik, "optimizer_prune_level", "1"},
   490  	{ScopeGlobal | ScopeStochastik, "completion_type", "NO_CHAIN"},
   491  	{ScopeGlobal, "binlog_checksum", "CRC32"},
   492  	{ScopeNone, "report_port", "3306"},
   493  	{ScopeGlobal | ScopeStochastik, ShowOldTemporals, "0"},
   494  	{ScopeGlobal, "query_cache_limit", "1048576"},
   495  	{ScopeGlobal, "innodb_buffer_pool_size", "134217728"},
   496  	{ScopeGlobal, InnodbAdaptiveFlushing, "1"},
   497  	{ScopeNone, "datadir", "/usr/local/allegrosql/data/"},
   498  	{ScopeGlobal | ScopeStochastik, WaitTimeout, strconv.FormatInt(DefWaitTimeout, 10)},
   499  	{ScopeGlobal, "innodb_monitor_enable", ""},
   500  	{ScopeNone, "date_format", "%Y-%m-%d"},
   501  	{ScopeGlobal, "innodb_buffer_pool_filename", "ib_buffer_pool"},
   502  	{ScopeGlobal, "slow_launch_time", "2"},
   503  	{ScopeGlobal | ScopeStochastik, "ndb_use_transactions", ""},
   504  	{ScopeNone, "innodb_purge_threads", "1"},
   505  	{ScopeGlobal, "innodb_concurrency_tickets", "5000"},
   506  	{ScopeGlobal, "innodb_monitor_reset_all", ""},
   507  	{ScopeNone, "performance_schema_users_size", "100"},
   508  	{ScopeGlobal, "ndb_log_uFIDelated_only", ""},
   509  	{ScopeNone, "basedir", "/usr/local/allegrosql"},
   510  	{ScopeGlobal, "innodb_old_blocks_time", "1000"},
   511  	{ScopeGlobal, "innodb_stats_method", "nulls_equal"},
   512  	{ScopeGlobal | ScopeStochastik, InnodbLockWaitTimeout, strconv.FormatInt(DefInnodbLockWaitTimeout, 10)},
   513  	{ScopeGlobal, LocalInFile, "1"},
   514  	{ScopeGlobal | ScopeStochastik, "myisam_stats_method", "nulls_unequal"},
   515  	{ScopeNone, "version_compile_os", "osx10.8"},
   516  	{ScopeNone, "relay_log_recovery", "0"},
   517  	{ScopeNone, "old", "0"},
   518  	{ScopeGlobal | ScopeStochastik, InnodbBlockLocks, "1"},
   519  	{ScopeNone, PerformanceSchema, "0"},
   520  	{ScopeNone, "myisam_recover_options", "OFF"},
   521  	{ScopeGlobal | ScopeStochastik, NetBufferLength, "16384"},
   522  	{ScopeGlobal | ScopeStochastik, "binlog_row_image", "FULL"},
   523  	{ScopeNone, "innodb_locks_unsafe_for_binlog", "0"},
   524  	{ScopeStochastik, "rbr_exec_mode", ""},
   525  	{ScopeGlobal, "myisam_max_sort_file_size", "9223372036853727232"},
   526  	{ScopeNone, "back_log", "80"},
   527  	{ScopeNone, "lower_case_file_system", "1"},
   528  	{ScopeGlobal | ScopeStochastik, GroupConcatMaxLen, "1024"},
   529  	{ScopeStochastik, "pseudo_thread_id", ""},
   530  	{ScopeNone, "socket", "/tmp/myssock"},
   531  	{ScopeNone, "have_dynamic_loading", "YES"},
   532  	{ScopeGlobal, "rewriter_verbose", ""},
   533  	{ScopeGlobal, "innodb_undo_logs", "128"},
   534  	{ScopeNone, "performance_schema_max_cond_instances", "3504"},
   535  	{ScopeGlobal, "delayed_insert_limit", "100"},
   536  	{ScopeGlobal, Flush, "0"},
   537  	{ScopeGlobal | ScopeStochastik, "eq_range_index_dive_limit", "10"},
   538  	{ScopeNone, "performance_schema_events_stages_history_size", "10"},
   539  	{ScopeGlobal | ScopeStochastik, "character_set_connection", allegrosql.DefaultCharset},
   540  	{ScopeGlobal, MyISAMUseMmap, "0"},
   541  	{ScopeGlobal | ScopeStochastik, "ndb_join_pushdown", ""},
   542  	{ScopeGlobal | ScopeStochastik, CharacterSetServer, allegrosql.DefaultCharset},
   543  	{ScopeGlobal, "validate_password_special_char_count", "1"},
   544  	{ScopeNone, "performance_schema_max_thread_instances", "402"},
   545  	{ScopeGlobal | ScopeStochastik, "ndbinfo_show_hidden", ""},
   546  	{ScopeGlobal | ScopeStochastik, "net_read_timeout", "30"},
   547  	{ScopeNone, "innodb_page_size", "16384"},
   548  	{ScopeGlobal | ScopeStochastik, MaxAllowedPacket, "67108864"},
   549  	{ScopeNone, "innodb_log_file_size", "50331648"},
   550  	{ScopeGlobal, "sync_relay_log_info", "10000"},
   551  	{ScopeGlobal | ScopeStochastik, "optimizer_trace_limit", "1"},
   552  	{ScopeNone, "innodb_ft_max_token_size", "84"},
   553  	{ScopeGlobal, "validate_password_length", "8"},
   554  	{ScopeGlobal, "ndb_log_binlog_index", ""},
   555  	{ScopeGlobal, "innodb_api_bk_commit_interval", "5"},
   556  	{ScopeNone, "innodb_undo_directory", "."},
   557  	{ScopeNone, "bind_address", "*"},
   558  	{ScopeGlobal, "innodb_sync_spin_loops", "30"},
   559  	{ScopeGlobal | ScopeStochastik, ALLEGROSQLSafeUFIDelates, "0"},
   560  	{ScopeNone, "tmFIDelir", "/var/tmp/"},
   561  	{ScopeGlobal, "innodb_thread_concurrency", "0"},
   562  	{ScopeGlobal, "innodb_buffer_pool_dump_pct", ""},
   563  	{ScopeGlobal | ScopeStochastik, "lc_time_names", "en_US"},
   564  	{ScopeGlobal | ScopeStochastik, "max_memex_time", ""},
   565  	{ScopeGlobal | ScopeStochastik, EndMakersInJSON, "0"},
   566  	{ScopeGlobal, AvoidTemporalUpgrade, "0"},
   567  	{ScopeGlobal, "key_cache_age_threshold", "300"},
   568  	{ScopeGlobal, InnodbStatusOutput, "0"},
   569  	{ScopeStochastik, "identity", ""},
   570  	{ScopeGlobal | ScopeStochastik, "min_examined_row_limit", "0"},
   571  	{ScopeGlobal, "sync_frm", "ON"},
   572  	{ScopeGlobal, "innodb_online_alter_log_max_size", "134217728"},
   573  	{ScopeStochastik, WarningCount, "0"},
   574  	{ScopeStochastik, ErrorCount, "0"},
   575  	{ScopeGlobal | ScopeStochastik, "information_schema_stats_expiry", "86400"},
   576  	{ScopeGlobal, "thread_pool_size", "16"},
   577  	{ScopeGlobal | ScopeStochastik, WindowingUseHighPrecision, "ON"},
   578  	/* MilevaDB specific variables */
   579  	{ScopeStochastik, MilevaDBSnapshot, ""},
   580  	{ScopeStochastik, MilevaDBOptAggPushDown, BoolToIntStr(DefOptAggPushDown)},
   581  	{ScopeGlobal | ScopeStochastik, MilevaDBOptBCJ, BoolToIntStr(DefOptBCJ)},
   582  	{ScopeStochastik, MilevaDBOptDistinctAggPushDown, BoolToIntStr(config.GetGlobalConfig().Performance.DistinctAggPushDown)},
   583  	{ScopeStochastik, MilevaDBOptWriteRowID, BoolToIntStr(DefOptWriteRowID)},
   584  	{ScopeGlobal | ScopeStochastik, MilevaDBBuildStatsConcurrency, strconv.Itoa(DefBuildStatsConcurrency)},
   585  	{ScopeGlobal, MilevaDBAutoAnalyzeRatio, strconv.FormatFloat(DefAutoAnalyzeRatio, 'f', -1, 64)},
   586  	{ScopeGlobal, MilevaDBAutoAnalyzeStartTime, DefAutoAnalyzeStartTime},
   587  	{ScopeGlobal, MilevaDBAutoAnalyzeEndTime, DefAutoAnalyzeEndTime},
   588  	{ScopeStochastik, MilevaDBChecksumBlockConcurrency, strconv.Itoa(DefChecksumBlockConcurrency)},
   589  	{ScopeGlobal | ScopeStochastik, MilevaDBInterlockingDirectorateConcurrency, strconv.Itoa(DefInterlockingDirectorateConcurrency)},
   590  	{ScopeGlobal | ScopeStochastik, MilevaDBDistALLEGROSQLScanConcurrency, strconv.Itoa(DefDistALLEGROSQLScanConcurrency)},
   591  	{ScopeGlobal | ScopeStochastik, MilevaDBOptInSubqToJoinAnPosetDagg, BoolToIntStr(DefOptInSubqToJoinAnPosetDagg)},
   592  	{ScopeGlobal | ScopeStochastik, MilevaDBOptCorrelationThreshold, strconv.FormatFloat(DefOptCorrelationThreshold, 'f', -1, 64)},
   593  	{ScopeGlobal | ScopeStochastik, MilevaDBOptCorrelationExpFactor, strconv.Itoa(DefOptCorrelationExpFactor)},
   594  	{ScopeGlobal | ScopeStochastik, MilevaDBOptCPUFactor, strconv.FormatFloat(DefOptCPUFactor, 'f', -1, 64)},
   595  	{ScopeGlobal | ScopeStochastik, MilevaDBOptTiFlashConcurrencyFactor, strconv.FormatFloat(DefOptTiFlashConcurrencyFactor, 'f', -1, 64)},
   596  	{ScopeGlobal | ScopeStochastik, MilevaDBOptCopCPUFactor, strconv.FormatFloat(DefOptCopCPUFactor, 'f', -1, 64)},
   597  	{ScopeGlobal | ScopeStochastik, MilevaDBOptNetworkFactor, strconv.FormatFloat(DefOptNetworkFactor, 'f', -1, 64)},
   598  	{ScopeGlobal | ScopeStochastik, MilevaDBOptScanFactor, strconv.FormatFloat(DefOptScanFactor, 'f', -1, 64)},
   599  	{ScopeGlobal | ScopeStochastik, MilevaDBOptDescScanFactor, strconv.FormatFloat(DefOptDescScanFactor, 'f', -1, 64)},
   600  	{ScopeGlobal | ScopeStochastik, MilevaDBOptSeekFactor, strconv.FormatFloat(DefOptSeekFactor, 'f', -1, 64)},
   601  	{ScopeGlobal | ScopeStochastik, MilevaDBOptMemoryFactor, strconv.FormatFloat(DefOptMemoryFactor, 'f', -1, 64)},
   602  	{ScopeGlobal | ScopeStochastik, MilevaDBOptDiskFactor, strconv.FormatFloat(DefOptDiskFactor, 'f', -1, 64)},
   603  	{ScopeGlobal | ScopeStochastik, MilevaDBOptConcurrencyFactor, strconv.FormatFloat(DefOptConcurrencyFactor, 'f', -1, 64)},
   604  	{ScopeGlobal | ScopeStochastik, MilevaDBIndexJoinBatchSize, strconv.Itoa(DefIndexJoinBatchSize)},
   605  	{ScopeGlobal | ScopeStochastik, MilevaDBIndexLookupSize, strconv.Itoa(DefIndexLookupSize)},
   606  	{ScopeGlobal | ScopeStochastik, MilevaDBIndexLookupConcurrency, strconv.Itoa(DefIndexLookupConcurrency)},
   607  	{ScopeGlobal | ScopeStochastik, MilevaDBIndexLookupJoinConcurrency, strconv.Itoa(DefIndexLookupJoinConcurrency)},
   608  	{ScopeGlobal | ScopeStochastik, MilevaDBIndexSerialScanConcurrency, strconv.Itoa(DefIndexSerialScanConcurrency)},
   609  	{ScopeGlobal | ScopeStochastik, MilevaDBSkipUTF8Check, BoolToIntStr(DefSkipUTF8Check)},
   610  	{ScopeGlobal | ScopeStochastik, MilevaDBSkipASCIICheck, BoolToIntStr(DefSkipASCIICheck)},
   611  	{ScopeStochastik, MilevaDBBatchInsert, BoolToIntStr(DefBatchInsert)},
   612  	{ScopeStochastik, MilevaDBBatchDelete, BoolToIntStr(DefBatchDelete)},
   613  	{ScopeStochastik, MilevaDBBatchCommit, BoolToIntStr(DefBatchCommit)},
   614  	{ScopeGlobal | ScopeStochastik, MilevaDBDMLBatchSize, strconv.Itoa(DefDMLBatchSize)},
   615  	{ScopeStochastik, MilevaDBCurrentTS, strconv.Itoa(DefCurretTS)},
   616  	{ScopeStochastik, MilevaDBLastTxnInfo, strconv.Itoa(DefCurretTS)},
   617  	{ScopeGlobal | ScopeStochastik, MilevaDBMaxChunkSize, strconv.Itoa(DefMaxChunkSize)},
   618  	{ScopeGlobal | ScopeStochastik, MilevaDBAllowBatchCop, strconv.Itoa(DefMilevaDBAllowBatchCop)},
   619  	{ScopeGlobal | ScopeStochastik, MilevaDBInitChunkSize, strconv.Itoa(DefInitChunkSize)},
   620  	{ScopeGlobal | ScopeStochastik, MilevaDBEnableCascadesCausetAppend, "0"},
   621  	{ScopeGlobal | ScopeStochastik, MilevaDBEnableIndexMerge, "0"},
   622  	{ScopeStochastik, MilevaDBMemQuotaQuery, strconv.FormatInt(config.GetGlobalConfig().MemQuotaQuery, 10)},
   623  	{ScopeStochastik, MilevaDBMemQuotaHashJoin, strconv.FormatInt(DefMilevaDBMemQuotaHashJoin, 10)},
   624  	{ScopeStochastik, MilevaDBMemQuotaMergeJoin, strconv.FormatInt(DefMilevaDBMemQuotaMergeJoin, 10)},
   625  	{ScopeStochastik, MilevaDBMemQuotaSort, strconv.FormatInt(DefMilevaDBMemQuotaSort, 10)},
   626  	{ScopeStochastik, MilevaDBMemQuotaTopn, strconv.FormatInt(DefMilevaDBMemQuotaTopn, 10)},
   627  	{ScopeStochastik, MilevaDBMemQuotaIndexLookupReader, strconv.FormatInt(DefMilevaDBMemQuotaIndexLookupReader, 10)},
   628  	{ScopeStochastik, MilevaDBMemQuotaIndexLookupJoin, strconv.FormatInt(DefMilevaDBMemQuotaIndexLookupJoin, 10)},
   629  	{ScopeStochastik, MilevaDBMemQuotaNestedLoopApply, strconv.FormatInt(DefMilevaDBMemQuotaNestedLoopApply, 10)},
   630  	{ScopeStochastik, MilevaDBEnableStreaming, "0"},
   631  	{ScopeStochastik, MilevaDBEnableChunkRPC, "1"},
   632  	{ScopeStochastik, TxnIsolationOneShot, ""},
   633  	{ScopeGlobal | ScopeStochastik, MilevaDBEnableBlockPartition, "on"},
   634  	{ScopeGlobal | ScopeStochastik, MilevaDBHashJoinConcurrency, strconv.Itoa(DefMilevaDBHashJoinConcurrency)},
   635  	{ScopeGlobal | ScopeStochastik, MilevaDBProjectionConcurrency, strconv.Itoa(DefMilevaDBProjectionConcurrency)},
   636  	{ScopeGlobal | ScopeStochastik, MilevaDBHashAggPartialConcurrency, strconv.Itoa(DefMilevaDBHashAggPartialConcurrency)},
   637  	{ScopeGlobal | ScopeStochastik, MilevaDBHashAggFinalConcurrency, strconv.Itoa(DefMilevaDBHashAggFinalConcurrency)},
   638  	{ScopeGlobal | ScopeStochastik, MilevaDBWindowConcurrency, strconv.Itoa(DefMilevaDBWindowConcurrency)},
   639  	{ScopeGlobal | ScopeStochastik, MilevaDBEnableParallelApply, BoolToIntStr(DefMilevaDBEnableParallelApply)},
   640  	{ScopeGlobal | ScopeStochastik, MilevaDBBackoffLockFast, strconv.Itoa(ekv.DefBackoffLockFast)},
   641  	{ScopeGlobal | ScopeStochastik, MilevaDBBackOffWeight, strconv.Itoa(ekv.DefBackOffWeight)},
   642  	{ScopeGlobal | ScopeStochastik, MilevaDBRetryLimit, strconv.Itoa(DefMilevaDBRetryLimit)},
   643  	{ScopeGlobal | ScopeStochastik, MilevaDBDisableTxnAutoRetry, BoolToIntStr(DefMilevaDBDisableTxnAutoRetry)},
   644  	{ScopeGlobal | ScopeStochastik, MilevaDBConstraintCheckInPlace, BoolToIntStr(DefMilevaDBConstraintCheckInPlace)},
   645  	{ScopeGlobal | ScopeStochastik, MilevaDBTxnMode, DefMilevaDBTxnMode},
   646  	{ScopeGlobal, MilevaDBRowFormatVersion, strconv.Itoa(DefMilevaDBRowFormatV1)},
   647  	{ScopeStochastik, MilevaDBOptimizerSelectivityLevel, strconv.Itoa(DefMilevaDBOptimizerSelectivityLevel)},
   648  	{ScopeGlobal | ScopeStochastik, MilevaDBEnableWindowFunction, BoolToIntStr(DefEnableWindowFunction)},
   649  	{ScopeGlobal | ScopeStochastik, MilevaDBEnableVectorizedExpression, BoolToIntStr(DefEnableVectorizedExpression)},
   650  	{ScopeGlobal | ScopeStochastik, MilevaDBEnableFastAnalyze, BoolToIntStr(DefMilevaDBUseFastAnalyze)},
   651  	{ScopeGlobal | ScopeStochastik, MilevaDBSkipIsolationLevelCheck, BoolToIntStr(DefMilevaDBSkipIsolationLevelCheck)},
   652  	/* The following variable is defined as stochastik scope but is actually server scope. */
   653  	{ScopeStochastik, MilevaDBGeneralLog, strconv.Itoa(DefMilevaDBGeneralLog)},
   654  	{ScopeStochastik, MilevaDBPProfALLEGROSQLCPU, strconv.Itoa(DefMilevaDBPProfALLEGROSQLCPU)},
   655  	{ScopeStochastik, MilevaDBDBSSlowOprThreshold, strconv.Itoa(DefMilevaDBDBSSlowOprThreshold)},
   656  	{ScopeStochastik, MilevaDBConfig, ""},
   657  	{ScopeGlobal, MilevaDBDBSReorgWorkerCount, strconv.Itoa(DefMilevaDBDBSReorgWorkerCount)},
   658  	{ScopeGlobal, MilevaDBDBSReorgBatchSize, strconv.Itoa(DefMilevaDBDBSReorgBatchSize)},
   659  	{ScopeGlobal, MilevaDBDBSErrorCountLimit, strconv.Itoa(DefMilevaDBDBSErrorCountLimit)},
   660  	{ScopeStochastik, MilevaDBDBSReorgPriority, "PRIORITY_LOW"},
   661  	{ScopeGlobal, MilevaDBMaxDeltaSchemaCount, strconv.Itoa(DefMilevaDBMaxDeltaSchemaCount)},
   662  	{ScopeGlobal, MilevaDBEnableChangeDeferredCausetType, BoolToIntStr(DefMilevaDBChangeDeferredCausetType)},
   663  	{ScopeStochastik, MilevaDBForcePriority, allegrosql.Priority2Str[DefMilevaDBForcePriority]},
   664  	{ScopeStochastik, MilevaDBEnableRadixJoin, BoolToIntStr(DefMilevaDBUseRadixJoin)},
   665  	{ScopeGlobal | ScopeStochastik, MilevaDBOptJoinReorderThreshold, strconv.Itoa(DefMilevaDBOptJoinReorderThreshold)},
   666  	{ScopeStochastik, MilevaDBSlowQueryFile, ""},
   667  	{ScopeGlobal, MilevaDBScatterRegion, BoolToIntStr(DefMilevaDBScatterRegion)},
   668  	{ScopeStochastik, MilevaDBWaitSplitRegionFinish, BoolToIntStr(DefMilevaDBWaitSplitRegionFinish)},
   669  	{ScopeStochastik, MilevaDBWaitSplitRegionTimeout, strconv.Itoa(DefWaitSplitRegionTimeout)},
   670  	{ScopeStochastik, MilevaDBLowResolutionTSO, "0"},
   671  	{ScopeStochastik, MilevaDBExpensiveQueryTimeThreshold, strconv.Itoa(DefMilevaDBExpensiveQueryTimeThreshold)},
   672  	{ScopeGlobal | ScopeStochastik, MilevaDBEnableNoopFuncs, BoolToIntStr(DefMilevaDBEnableNoopFuncs)},
   673  	{ScopeStochastik, MilevaDBReplicaRead, "leader"},
   674  	{ScopeStochastik, MilevaDBAllowRemoveAutoInc, BoolToIntStr(DefMilevaDBAllowRemoveAutoInc)},
   675  	{ScopeGlobal | ScopeStochastik, MilevaDBEnableStmtSummary, BoolToIntStr(config.GetGlobalConfig().StmtSummary.Enable)},
   676  	{ScopeGlobal | ScopeStochastik, MilevaDBStmtSummaryInternalQuery, BoolToIntStr(config.GetGlobalConfig().StmtSummary.EnableInternalQuery)},
   677  	{ScopeGlobal | ScopeStochastik, MilevaDBStmtSummaryRefreshInterval, strconv.Itoa(config.GetGlobalConfig().StmtSummary.RefreshInterval)},
   678  	{ScopeGlobal | ScopeStochastik, MilevaDBStmtSummaryHistorySize, strconv.Itoa(config.GetGlobalConfig().StmtSummary.HistorySize)},
   679  	{ScopeGlobal | ScopeStochastik, MilevaDBStmtSummaryMaxStmtCount, strconv.FormatUint(uint64(config.GetGlobalConfig().StmtSummary.MaxStmtCount), 10)},
   680  	{ScopeGlobal | ScopeStochastik, MilevaDBStmtSummaryMaxALLEGROSQLLength, strconv.FormatUint(uint64(config.GetGlobalConfig().StmtSummary.MaxALLEGROSQLLength), 10)},
   681  	{ScopeGlobal | ScopeStochastik, MilevaDBCaptureCausetBaseline, "off"},
   682  	{ScopeGlobal | ScopeStochastik, MilevaDBUseCausetBaselines, boolToOnOff(DefMilevaDBUseCausetBaselines)},
   683  	{ScopeGlobal | ScopeStochastik, MilevaDBEvolveCausetBaselines, boolToOnOff(DefMilevaDBEvolveCausetBaselines)},
   684  	{ScopeGlobal, MilevaDBEvolveCausetTaskMaxTime, strconv.Itoa(DefMilevaDBEvolveCausetTaskMaxTime)},
   685  	{ScopeGlobal, MilevaDBEvolveCausetTaskStartTime, DefMilevaDBEvolveCausetTaskStartTime},
   686  	{ScopeGlobal, MilevaDBEvolveCausetTaskEndTime, DefMilevaDBEvolveCausetTaskEndTime},
   687  	{ScopeStochastik, MilevaDBIsolationReadEngines, strings.Join(config.GetGlobalConfig().IsolationRead.Engines, ", ")},
   688  	{ScopeGlobal | ScopeStochastik, MilevaDBStoreLimit, strconv.FormatInt(atomic.LoadInt64(&config.GetGlobalConfig().EinsteinDBClient.StoreLimit), 10)},
   689  	{ScopeStochastik, MilevaDBMetricSchemaStep, strconv.Itoa(DefMilevaDBMetricSchemaStep)},
   690  	{ScopeStochastik, MilevaDBMetricSchemaRangeDuration, strconv.Itoa(DefMilevaDBMetricSchemaRangeDuration)},
   691  	{ScopeStochastik, MilevaDBSlowLogThreshold, strconv.Itoa(logutil.DefaultSlowThreshold)},
   692  	{ScopeStochastik, MilevaDBRecordCausetInSlowLog, strconv.Itoa(logutil.DefaultRecordCausetInSlowLog)},
   693  	{ScopeStochastik, MilevaDBEnableSlowLog, BoolToIntStr(logutil.DefaultMilevaDBEnableSlowLog)},
   694  	{ScopeStochastik, MilevaDBQueryLogMaxLen, strconv.Itoa(logutil.DefaultQueryLogMaxLen)},
   695  	{ScopeStochastik, MilevaDBCheckMb4ValueInUTF8, BoolToIntStr(config.GetGlobalConfig().CheckMb4ValueInUTF8)},
   696  	{ScopeStochastik, MilevaDBFoundInCausetCache, BoolToIntStr(DefMilevaDBFoundInCausetCache)},
   697  	{ScopeStochastik, MilevaDBEnableDefCauslectInterDircutionInfo, BoolToIntStr(DefMilevaDBEnableDefCauslectInterDircutionInfo)},
   698  	{ScopeGlobal | ScopeStochastik, MilevaDBAllowAutoRandExplicitInsert, boolToOnOff(DefMilevaDBAllowAutoRandExplicitInsert)},
   699  	{ScopeGlobal | ScopeStochastik, MilevaDBEnableClusteredIndex, BoolToIntStr(DefMilevaDBEnableClusteredIndex)},
   700  	{ScopeGlobal | ScopeStochastik, MilevaDBPartitionPruneMode, string(StaticOnly)},
   701  	{ScopeGlobal, MilevaDBSlowLogMasking, BoolToIntStr(DefMilevaDBSlowLogMasking)},
   702  	{ScopeGlobal, MilevaDBRedactLog, strconv.Itoa(config.DefMilevaDBRedactLog)},
   703  	{ScopeGlobal | ScopeStochastik, MilevaDBShardAllocateStep, strconv.Itoa(DefMilevaDBShardAllocateStep)},
   704  	{ScopeGlobal, MilevaDBEnableTelemetry, BoolToIntStr(DefMilevaDBEnableTelemetry)},
   705  	{ScopeGlobal | ScopeStochastik, MilevaDBEnableAmendPessimisticTxn, boolToOnOff(DefMilevaDBEnableAmendPessimisticTxn)},
   706  
   707  	// for compatibility purpose, we should leave them alone.
   708  	// TODO: Follow the Terminology UFIDelates of MyALLEGROSQL after their changes arrived.
   709  	// https://mysqlhighavailability.com/allegrosql-terminology-uFIDelates/
   710  	{ScopeStochastik, PseudoSlaveMode, ""},
   711  	{ScopeGlobal, "slave_pending_jobs_size_max", "16777216"},
   712  	{ScopeGlobal, "slave_transaction_retries", "10"},
   713  	{ScopeGlobal, "slave_checkpoint_period", "300"},
   714  	{ScopeGlobal, MasterVerifyChecksum, "0"},
   715  	{ScopeGlobal, "rpl_semi_sync_master_trace_level", ""},
   716  	{ScopeGlobal, "master_info_repository", "FILE"},
   717  	{ScopeGlobal, "rpl_stop_slave_timeout", "31536000"},
   718  	{ScopeGlobal, "slave_net_timeout", "3600"},
   719  	{ScopeGlobal, "sync_master_info", "10000"},
   720  	{ScopeGlobal, "init_slave", ""},
   721  	{ScopeGlobal, SlaveCompressedProtodefCaus, "0"},
   722  	{ScopeGlobal, "rpl_semi_sync_slave_trace_level", ""},
   723  	{ScopeGlobal, LogSlowSlaveStatements, "0"},
   724  	{ScopeGlobal, "slave_checkpoint_group", "512"},
   725  	{ScopeNone, "slave_load_tmFIDelir", "/var/tmp/"},
   726  	{ScopeGlobal, "slave_parallel_type", ""},
   727  	{ScopeGlobal, "slave_parallel_workers", "0"},
   728  	{ScopeGlobal, "rpl_semi_sync_master_timeout", ""},
   729  	{ScopeNone, "slave_skip_errors", "OFF"},
   730  	{ScopeGlobal, "sql_slave_skip_counter", "0"},
   731  	{ScopeGlobal, "rpl_semi_sync_slave_enabled", ""},
   732  	{ScopeGlobal, "rpl_semi_sync_master_enabled", ""},
   733  	{ScopeGlobal, "slave_preserve_commit_order", ""},
   734  	{ScopeGlobal, "slave_exec_mode", "STRICT"},
   735  	{ScopeNone, "log_slave_uFIDelates", "0"},
   736  	{ScopeGlobal, "rpl_semi_sync_master_wait_point", ""},
   737  	{ScopeGlobal, "slave_sql_verify_checksum", "1"},
   738  	{ScopeGlobal, "slave_max_allowed_packet", "1073741824"},
   739  	{ScopeGlobal, "rpl_semi_sync_master_wait_for_slave_count", ""},
   740  	{ScopeGlobal, "rpl_semi_sync_master_wait_no_slave", ""},
   741  	{ScopeGlobal, "slave_rows_search_algorithms", "TABLE_SCAN,INDEX_SCAN"},
   742  	{ScopeGlobal, SlaveAllowBatching, "0"},
   743  }
   744  
   745  // SynonymsSysVariables is synonyms of system variables.
   746  var SynonymsSysVariables = map[string][]string{}
   747  
   748  func addSynonymsSysVariables(synonyms ...string) {
   749  	for _, s := range synonyms {
   750  		SynonymsSysVariables[s] = synonyms
   751  	}
   752  }
   753  
   754  func initSynonymsSysVariables() {
   755  	addSynonymsSysVariables(TxnIsolation, TransactionIsolation)
   756  	addSynonymsSysVariables(TxReadOnly, TransactionReadOnly)
   757  }
   758  
   759  // SetNamesVariables is the system variable names related to set names memexs.
   760  var SetNamesVariables = []string{
   761  	"character_set_client",
   762  	"character_set_connection",
   763  	"character_set_results",
   764  }
   765  
   766  // SetCharsetVariables is the system variable names related to set charset memexs.
   767  var SetCharsetVariables = []string{
   768  	"character_set_client",
   769  	"character_set_results",
   770  }
   771  
   772  const (
   773  	// CharacterSetConnection is the name for character_set_connection system variable.
   774  	CharacterSetConnection = "character_set_connection"
   775  	// DefCauslationConnection is the name for defCauslation_connection system variable.
   776  	DefCauslationConnection = "defCauslation_connection"
   777  	// CharsetDatabase is the name for character_set_database system variable.
   778  	CharsetDatabase = "character_set_database"
   779  	// DefCauslationDatabase is the name for defCauslation_database system variable.
   780  	DefCauslationDatabase = "defCauslation_database"
   781  	// GeneralLog is the name for 'general_log' system variable.
   782  	GeneralLog = "general_log"
   783  	// AvoidTemporalUpgrade is the name for 'avoid_temporal_upgrade' system variable.
   784  	AvoidTemporalUpgrade = "avoid_temporal_upgrade"
   785  	// MaxPreparedStmtCount is the name for 'max_prepared_stmt_count' system variable.
   786  	MaxPreparedStmtCount = "max_prepared_stmt_count"
   787  	// BigBlocks is the name for 'big_blocks' system variable.
   788  	BigBlocks = "big_blocks"
   789  	// CheckProxyUsers is the name for 'check_proxy_users' system variable.
   790  	CheckProxyUsers = "check_proxy_users"
   791  	// CoreFile is the name for 'embedded_file' system variable.
   792  	CoreFile = "embedded_file"
   793  	// DefaultWeekFormat is the name for 'default_week_format' system variable.
   794  	DefaultWeekFormat = "default_week_format"
   795  	// GroupConcatMaxLen is the name for 'group_concat_max_len' system variable.
   796  	GroupConcatMaxLen = "group_concat_max_len"
   797  	// DelayKeyWrite is the name for 'delay_key_write' system variable.
   798  	DelayKeyWrite = "delay_key_write"
   799  	// EndMakersInJSON is the name for 'end_markers_in_json' system variable.
   800  	EndMakersInJSON = "end_markers_in_json"
   801  	// InnodbCommitConcurrency is the name for 'innodb_commit_concurrency' system variable.
   802  	InnodbCommitConcurrency = "innodb_commit_concurrency"
   803  	// InnodbFastShutdown is the name for 'innodb_fast_shutdown' system variable.
   804  	InnodbFastShutdown = "innodb_fast_shutdown"
   805  	// InnodbLockWaitTimeout is the name for 'innodb_lock_wait_timeout' system variable.
   806  	InnodbLockWaitTimeout = "innodb_lock_wait_timeout"
   807  	// ALLEGROSQLLogBin is the name for 'sql_log_bin' system variable.
   808  	ALLEGROSQLLogBin = "sql_log_bin"
   809  	// LogBin is the name for 'log_bin' system variable.
   810  	LogBin = "log_bin"
   811  	// MaxSortLength is the name for 'max_sort_length' system variable.
   812  	MaxSortLength = "max_sort_length"
   813  	// MaxSpRecursionDepth is the name for 'max_sp_recursion_depth' system variable.
   814  	MaxSpRecursionDepth = "max_sp_recursion_depth"
   815  	// MaxUserConnections is the name for 'max_user_connections' system variable.
   816  	MaxUserConnections = "max_user_connections"
   817  	// OfflineMode is the name for 'offline_mode' system variable.
   818  	OfflineMode = "offline_mode"
   819  	// InteractiveTimeout is the name for 'interactive_timeout' system variable.
   820  	InteractiveTimeout = "interactive_timeout"
   821  	// FlushTime is the name for 'flush_time' system variable.
   822  	FlushTime = "flush_time"
   823  	// PseudoSlaveMode is the name for 'pseudo_slave_mode' system variable.
   824  	PseudoSlaveMode = "pseudo_slave_mode"
   825  	// LowPriorityUFIDelates is the name for 'low_priority_uFIDelates' system variable.
   826  	LowPriorityUFIDelates = "low_priority_uFIDelates"
   827  	// StochastikTrackGtids is the name for 'stochastik_track_gtids' system variable.
   828  	StochastikTrackGtids = "stochastik_track_gtids"
   829  	// OldPasswords is the name for 'old_passwords' system variable.
   830  	OldPasswords = "old_passwords"
   831  	// MaxConnections is the name for 'max_connections' system variable.
   832  	MaxConnections = "max_connections"
   833  	// SkipNameResolve is the name for 'skip_name_resolve' system variable.
   834  	SkipNameResolve = "skip_name_resolve"
   835  	// ForeignKeyChecks is the name for 'foreign_key_checks' system variable.
   836  	ForeignKeyChecks = "foreign_key_checks"
   837  	// ALLEGROSQLSafeUFIDelates is the name for 'sql_safe_uFIDelates' system variable.
   838  	ALLEGROSQLSafeUFIDelates = "sql_safe_uFIDelates"
   839  	// WarningCount is the name for 'warning_count' system variable.
   840  	WarningCount = "warning_count"
   841  	// ErrorCount is the name for 'error_count' system variable.
   842  	ErrorCount = "error_count"
   843  	// ALLEGROSQLSelectLimit is the name for 'sql_select_limit' system variable.
   844  	ALLEGROSQLSelectLimit = "sql_select_limit"
   845  	// MaxConnectErrors is the name for 'max_connect_errors' system variable.
   846  	MaxConnectErrors = "max_connect_errors"
   847  	// BlockDefinitionCache is the name for 'block_definition_cache' system variable.
   848  	BlockDefinitionCache = "block_definition_cache"
   849  	// TmpBlockSize is the name for 'tmp_block_size' system variable.
   850  	TmpBlockSize = "tmp_block_size"
   851  	// ConnectTimeout is the name for 'connect_timeout' system variable.
   852  	ConnectTimeout = "connect_timeout"
   853  	// SyncBinlog is the name for 'sync_binlog' system variable.
   854  	SyncBinlog = "sync_binlog"
   855  	// BlockEncryptionMode is the name for 'block_encryption_mode' system variable.
   856  	BlockEncryptionMode = "block_encryption_mode"
   857  	// WaitTimeout is the name for 'wait_timeout' system variable.
   858  	WaitTimeout = "wait_timeout"
   859  	// ValidatePasswordNumberCount is the name of 'validate_password_number_count' system variable.
   860  	ValidatePasswordNumberCount = "validate_password_number_count"
   861  	// ValidatePasswordLength is the name of 'validate_password_length' system variable.
   862  	ValidatePasswordLength = "validate_password_length"
   863  	// PluginDir is the name of 'plugin_dir' system variable.
   864  	PluginDir = "plugin_dir"
   865  	// PluginLoad is the name of 'plugin_load' system variable.
   866  	PluginLoad = "plugin_load"
   867  	// Port is the name for 'port' system variable.
   868  	Port = "port"
   869  	// DataDir is the name for 'datadir' system variable.
   870  	DataDir = "datadir"
   871  	// Profiling is the name for 'Profiling' system variable.
   872  	Profiling = "profiling"
   873  	// Socket is the name for 'socket' system variable.
   874  	Socket = "socket"
   875  	// BinlogOrderCommits is the name for 'binlog_order_commits' system variable.
   876  	BinlogOrderCommits = "binlog_order_commits"
   877  	// MasterVerifyChecksum is the name for 'master_verify_checksum' system variable.
   878  	MasterVerifyChecksum = "master_verify_checksum"
   879  	// ValidatePasswordCheckUserName is the name for 'validate_password_check_user_name' system variable.
   880  	ValidatePasswordCheckUserName = "validate_password_check_user_name"
   881  	// SuperReadOnly is the name for 'super_read_only' system variable.
   882  	SuperReadOnly = "super_read_only"
   883  	// ALLEGROSQLNotes is the name for 'sql_notes' system variable.
   884  	ALLEGROSQLNotes = "sql_notes"
   885  	// QueryCacheType is the name for 'query_cache_type' system variable.
   886  	QueryCacheType = "query_cache_type"
   887  	// SlaveCompressedProtodefCaus is the name for 'slave_compressed_protodefCaus' system variable.
   888  	SlaveCompressedProtodefCaus = "slave_compressed_protodefCaus"
   889  	// BinlogRowQueryLogEvents is the name for 'binlog_rows_query_log_events' system variable.
   890  	BinlogRowQueryLogEvents = "binlog_rows_query_log_events"
   891  	// LogSlowSlaveStatements is the name for 'log_slow_slave_memexs' system variable.
   892  	LogSlowSlaveStatements = "log_slow_slave_memexs"
   893  	// LogSlowAdminStatements is the name for 'log_slow_admin_memexs' system variable.
   894  	LogSlowAdminStatements = "log_slow_admin_memexs"
   895  	// LogQueriesNotUsingIndexes is the name for 'log_queries_not_using_indexes' system variable.
   896  	LogQueriesNotUsingIndexes = "log_queries_not_using_indexes"
   897  	// QueryCacheWlockInvalidate is the name for 'query_cache_wlock_invalidate' system variable.
   898  	QueryCacheWlockInvalidate = "query_cache_wlock_invalidate"
   899  	// ALLEGROSQLAutoIsNull is the name for 'sql_auto_is_null' system variable.
   900  	ALLEGROSQLAutoIsNull = "sql_auto_is_null"
   901  	// RelayLogPurge is the name for 'relay_log_purge' system variable.
   902  	RelayLogPurge = "relay_log_purge"
   903  	// AutomaticSpPrivileges is the name for 'automatic_sp_privileges' system variable.
   904  	AutomaticSpPrivileges = "automatic_sp_privileges"
   905  	// ALLEGROSQLQuoteShowCreate is the name for 'sql_quote_show_create' system variable.
   906  	ALLEGROSQLQuoteShowCreate = "sql_quote_show_create"
   907  	// SlowQueryLog is the name for 'slow_query_log' system variable.
   908  	SlowQueryLog = "slow_query_log"
   909  	// BinlogDirectNonTransactionalUFIDelates is the name for 'binlog_direct_non_transactional_uFIDelates' system variable.
   910  	BinlogDirectNonTransactionalUFIDelates = "binlog_direct_non_transactional_uFIDelates"
   911  	// ALLEGROSQLBigSelects is the name for 'sql_big_selects' system variable.
   912  	ALLEGROSQLBigSelects = "sql_big_selects"
   913  	// LogBinTrustFunctionCreators is the name for 'log_bin_trust_function_creators' system variable.
   914  	LogBinTrustFunctionCreators = "log_bin_trust_function_creators"
   915  	// OldAlterBlock is the name for 'old_alter_block' system variable.
   916  	OldAlterBlock = "old_alter_block"
   917  	// EnforceGtidConsistency is the name for 'enforce_gtid_consistency' system variable.
   918  	EnforceGtidConsistency = "enforce_gtid_consistency"
   919  	// SecureAuth is the name for 'secure_auth' system variable.
   920  	SecureAuth = "secure_auth"
   921  	// UniqueChecks is the name for 'unique_checks' system variable.
   922  	UniqueChecks = "unique_checks"
   923  	// ALLEGROSQLWarnings is the name for 'sql_warnings' system variable.
   924  	ALLEGROSQLWarnings = "sql_warnings"
   925  	// AutoCommit is the name for 'autocommit' system variable.
   926  	AutoCommit = "autocommit"
   927  	// KeepFilesOnCreate is the name for 'keep_files_on_create' system variable.
   928  	KeepFilesOnCreate = "keep_files_on_create"
   929  	// ShowOldTemporals is the name for 'show_old_temporals' system variable.
   930  	ShowOldTemporals = "show_old_temporals"
   931  	// LocalInFile is the name for 'local_infile' system variable.
   932  	LocalInFile = "local_infile"
   933  	// PerformanceSchema is the name for 'performance_schema' system variable.
   934  	PerformanceSchema = "performance_schema"
   935  	// Flush is the name for 'flush' system variable.
   936  	Flush = "flush"
   937  	// SlaveAllowBatching is the name for 'slave_allow_batching' system variable.
   938  	SlaveAllowBatching = "slave_allow_batching"
   939  	// MyISAMUseMmap is the name for 'myisam_use_mmap' system variable.
   940  	MyISAMUseMmap = "myisam_use_mmap"
   941  	// InnodbFilePerBlock is the name for 'innodb_file_per_block' system variable.
   942  	InnodbFilePerBlock = "innodb_file_per_block"
   943  	// InnodbLogCompressedPages is the name for 'innodb_log_compressed_pages' system variable.
   944  	InnodbLogCompressedPages = "innodb_log_compressed_pages"
   945  	// InnodbPrintAllDeadlocks is the name for 'innodb_print_all_deadlocks' system variable.
   946  	InnodbPrintAllDeadlocks = "innodb_print_all_deadlocks"
   947  	// InnodbStrictMode is the name for 'innodb_strict_mode' system variable.
   948  	InnodbStrictMode = "innodb_strict_mode"
   949  	// InnodbCmpPerIndexEnabled is the name for 'innodb_cmp_per_index_enabled' system variable.
   950  	InnodbCmpPerIndexEnabled = "innodb_cmp_per_index_enabled"
   951  	// InnodbBufferPoolDumpAtShutdown is the name for 'innodb_buffer_pool_dump_at_shutdown' system variable.
   952  	InnodbBufferPoolDumpAtShutdown = "innodb_buffer_pool_dump_at_shutdown"
   953  	// InnodbAdaptiveHashIndex is the name for 'innodb_adaptive_hash_index' system variable.
   954  	InnodbAdaptiveHashIndex = "innodb_adaptive_hash_index"
   955  	// InnodbFtEnableStopword is the name for 'innodb_ft_enable_stopword' system variable.
   956  	InnodbFtEnableStopword = "innodb_ft_enable_stopword"
   957  	// InnodbSupportXA is the name for 'innodb_support_xa' system variable.
   958  	InnodbSupportXA = "innodb_support_xa"
   959  	// InnodbOptimizeFullTextOnly is the name for 'innodb_optimize_fulltext_only' system variable.
   960  	InnodbOptimizeFullTextOnly = "innodb_optimize_fulltext_only"
   961  	// InnodbStatusOutputLocks is the name for 'innodb_status_output_locks' system variable.
   962  	InnodbStatusOutputLocks = "innodb_status_output_locks"
   963  	// InnodbBufferPoolDumpNow is the name for 'innodb_buffer_pool_dump_now' system variable.
   964  	InnodbBufferPoolDumpNow = "innodb_buffer_pool_dump_now"
   965  	// InnodbBufferPoolLoadNow is the name for 'innodb_buffer_pool_load_now' system variable.
   966  	InnodbBufferPoolLoadNow = "innodb_buffer_pool_load_now"
   967  	// InnodbStatsOnMetadata is the name for 'innodb_stats_on_spacetimedata' system variable.
   968  	InnodbStatsOnMetadata = "innodb_stats_on_spacetimedata"
   969  	// InnodbDisableSortFileCache is the name for 'innodb_disable_sort_file_cache' system variable.
   970  	InnodbDisableSortFileCache = "innodb_disable_sort_file_cache"
   971  	// InnodbStatsAutoRecalc is the name for 'innodb_stats_auto_recalc' system variable.
   972  	InnodbStatsAutoRecalc = "innodb_stats_auto_recalc"
   973  	// InnodbBufferPoolLoadAbort is the name for 'innodb_buffer_pool_load_abort' system variable.
   974  	InnodbBufferPoolLoadAbort = "innodb_buffer_pool_load_abort"
   975  	// InnodbStatsPersistent is the name for 'innodb_stats_persistent' system variable.
   976  	InnodbStatsPersistent = "innodb_stats_persistent"
   977  	// InnodbRandomReadAhead is the name for 'innodb_random_read_ahead' system variable.
   978  	InnodbRandomReadAhead = "innodb_random_read_ahead"
   979  	// InnodbAdaptiveFlushing is the name for 'innodb_adaptive_flushing' system variable.
   980  	InnodbAdaptiveFlushing = "innodb_adaptive_flushing"
   981  	// InnodbBlockLocks is the name for 'innodb_block_locks' system variable.
   982  	InnodbBlockLocks = "innodb_block_locks"
   983  	// InnodbStatusOutput is the name for 'innodb_status_output' system variable.
   984  	InnodbStatusOutput = "innodb_status_output"
   985  
   986  	// NetBufferLength is the name for 'net_buffer_length' system variable.
   987  	NetBufferLength = "net_buffer_length"
   988  	// QueryCacheSize is the name of 'query_cache_size' system variable.
   989  	QueryCacheSize = "query_cache_size"
   990  	// TxReadOnly is the name of 'tx_read_only' system variable.
   991  	TxReadOnly = "tx_read_only"
   992  	// TransactionReadOnly is the name of 'transaction_read_only' system variable.
   993  	TransactionReadOnly = "transaction_read_only"
   994  	// CharacterSetServer is the name of 'character_set_server' system variable.
   995  	CharacterSetServer = "character_set_server"
   996  	// AutoIncrementIncrement is the name of 'auto_increment_increment' system variable.
   997  	AutoIncrementIncrement = "auto_increment_increment"
   998  	// AutoIncrementOffset is the name of 'auto_increment_offset' system variable.
   999  	AutoIncrementOffset = "auto_increment_offset"
  1000  	// InitConnect is the name of 'init_connect' system variable.
  1001  	InitConnect = "init_connect"
  1002  	// DefCauslationServer is the name of 'defCauslation_server' variable.
  1003  	DefCauslationServer = "defCauslation_server"
  1004  	// NetWriteTimeout is the name of 'net_write_timeout' variable.
  1005  	NetWriteTimeout = "net_write_timeout"
  1006  	// ThreadPoolSize is the name of 'thread_pool_size' variable.
  1007  	ThreadPoolSize = "thread_pool_size"
  1008  	// WindowingUseHighPrecision is the name of 'windowing_use_high_precision' system variable.
  1009  	WindowingUseHighPrecision = "windowing_use_high_precision"
  1010  )
  1011  
  1012  // GlobalVarAccessor is the interface for accessing global scope system and status variables.
  1013  type GlobalVarAccessor interface {
  1014  	// GetAllSysVars gets all the global system variable values.
  1015  	GetAllSysVars() (map[string]string, error)
  1016  	// GetGlobalSysVar gets the global system variable value for name.
  1017  	GetGlobalSysVar(name string) (string, error)
  1018  	// SetGlobalSysVar sets the global system variable name to value.
  1019  	SetGlobalSysVar(name string, value string) error
  1020  }