github.com/dolthub/go-mysql-server@v0.18.0/sql/variables/system_variables.go (about) 1 // Copyright 2022 Dolthub, 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 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 package variables 16 17 import ( 18 "fmt" 19 "math" 20 "strings" 21 "sync" 22 "time" 23 24 "github.com/google/uuid" 25 "github.com/sirupsen/logrus" 26 27 gmstime "github.com/dolthub/go-mysql-server/internal/time" 28 "github.com/dolthub/go-mysql-server/sql" 29 "github.com/dolthub/go-mysql-server/sql/types" 30 ) 31 32 // TODO: Add from the following sources because MySQL likes to not have every variable on a single page: 33 // https://dev.mysql.com/doc/refman/8.0/en/mysql-cluster-options-variables.html 34 // There's also this page, which shows that a TON of variables are still missing ): 35 // https://dev.mysql.com/doc/refman/8.0/en/server-system-variable-reference.html 36 37 // serverStartUpTime is needed by uptime status variable 38 var serverStartUpTime = time.Now() 39 40 // globalSystemVariables is the underlying type of SystemVariables. 41 type globalSystemVariables struct { 42 mutex *sync.RWMutex 43 sysVarVals map[string]sql.SystemVarValue 44 } 45 46 var _ sql.SystemVariableRegistry = (*globalSystemVariables)(nil) 47 48 // AddSystemVariables adds the given system variables to the collection. If a name is already used by an existing 49 // variable, then it is overwritten with the new one. 50 func (sv *globalSystemVariables) AddSystemVariables(sysVars []sql.SystemVariable) { 51 sv.mutex.Lock() 52 defer sv.mutex.Unlock() 53 for _, originalSysVar := range sysVars { 54 sysVar := originalSysVar 55 lowerName := strings.ToLower(sysVar.Name) 56 sysVar.Name = lowerName 57 systemVars[lowerName] = sysVar 58 sv.sysVarVals[lowerName] = sql.SystemVarValue{ 59 Var: sysVar, 60 Val: sysVar.Default, 61 } 62 } 63 } 64 65 // AssignValues sets all of the values in the given map to their respective variables. If a variable cannot be found, or 66 // the value is invalid, then an error is returned. If the values contain any custom system variables, then make sure 67 // that they've been added using AddSystemVariables first. 68 func (sv *globalSystemVariables) AssignValues(vals map[string]interface{}) error { 69 sv.mutex.Lock() 70 defer sv.mutex.Unlock() 71 for varName, val := range vals { 72 varName = strings.ToLower(varName) 73 sysVar, ok := systemVars[varName] 74 if !ok { 75 return sql.ErrUnknownSystemVariable.New(varName) 76 } 77 convertedVal, _, err := sysVar.Type.Convert(val) 78 if err != nil { 79 return err 80 } 81 svv := sql.SystemVarValue{ 82 Var: sysVar, 83 Val: convertedVal, 84 } 85 if sysVar.NotifyChanged != nil { 86 err := sysVar.NotifyChanged(sql.SystemVariableScope_Global, svv) 87 if err != nil { 88 return err 89 } 90 } 91 sv.sysVarVals[varName] = svv 92 } 93 return nil 94 } 95 96 // NewSessionMap returns a new map of system variable values for sessions. 97 func (sv *globalSystemVariables) NewSessionMap() map[string]sql.SystemVarValue { 98 sv.mutex.RLock() 99 defer sv.mutex.RUnlock() 100 sessionVals := make(map[string]sql.SystemVarValue, len(sv.sysVarVals)) 101 for key, val := range sv.sysVarVals { 102 sessionVals[key] = val 103 } 104 return sessionVals 105 } 106 107 // GetGlobal returns the system variable definition and value for the given name. If the variable does not exist, returns 108 // false. Case-insensitive. 109 func (sv *globalSystemVariables) GetGlobal(name string) (sql.SystemVariable, interface{}, bool) { 110 sv.mutex.RLock() 111 defer sv.mutex.RUnlock() 112 name = strings.ToLower(name) 113 v, ok := systemVars[name] 114 if !ok { 115 return sql.SystemVariable{}, nil, false 116 } 117 118 if v.ValueFunction != nil { 119 result, err := v.ValueFunction() 120 if err != nil { 121 logrus.StandardLogger().Warnf("unable to get value for system variable %s: %s", name, err.Error()) 122 return v, nil, true 123 } 124 return v, result, true 125 } 126 127 // convert any set types to strings 128 sysVal := sv.sysVarVals[name] 129 if sysType, ok := v.Type.(sql.SetType); ok { 130 if sv, ok := sysVal.Val.(uint64); ok { 131 var err error 132 sysVal.Val, err = sysType.BitsToString(sv) 133 if err != nil { 134 return sql.SystemVariable{}, nil, false 135 } 136 } 137 } 138 return v, sysVal.Val, true 139 } 140 141 // SetGlobal sets the system variable with the given name to the given value. If the system variable does not exist, 142 // then an error is returned. Additionally, if the value is invalid for the variable's type then an error is returned. 143 // Only global dynamic variables may be set through this function, as it is intended for use through the SET GLOBAL 144 // statement. To set session system variables, use the appropriate function on the session context. To set values 145 // directly (such as when loading persisted values), use AssignValues. Case-insensitive. 146 func (sv *globalSystemVariables) SetGlobal(name string, val interface{}) error { 147 sv.mutex.Lock() 148 defer sv.mutex.Unlock() 149 name = strings.ToLower(name) 150 sysVar, ok := systemVars[name] 151 if !ok { 152 return sql.ErrUnknownSystemVariable.New(name) 153 } 154 if sysVar.Scope == sql.SystemVariableScope_Session { 155 return sql.ErrSystemVariableSessionOnly.New(name) 156 } 157 if !sysVar.Dynamic || sysVar.ValueFunction != nil { 158 return sql.ErrSystemVariableReadOnly.New(name) 159 } 160 convertedVal, _, err := sysVar.Type.Convert(val) 161 if err != nil { 162 return err 163 } 164 svv := sql.SystemVarValue{Var: sysVar, Val: convertedVal} 165 if sysVar.NotifyChanged != nil { 166 err := sysVar.NotifyChanged(sql.SystemVariableScope_Global, svv) 167 if err != nil { 168 return err 169 } 170 } 171 sv.sysVarVals[name] = svv 172 return nil 173 } 174 175 // GetAllGlobalVariables returns map of global system variables with their values. 176 func (sv *globalSystemVariables) GetAllGlobalVariables() map[string]interface{} { 177 sv.mutex.RLock() 178 defer sv.mutex.RUnlock() 179 180 m := make(map[string]interface{}) 181 for k, varVal := range sv.sysVarVals { 182 m[k] = varVal.Val 183 } 184 185 return m 186 } 187 188 // InitSystemVariables resets the systemVars singleton in the sql package 189 func InitSystemVariables() { 190 vars := &globalSystemVariables{ 191 mutex: &sync.RWMutex{}, 192 sysVarVals: make(map[string]sql.SystemVarValue, len(systemVars)), 193 } 194 for _, sysVar := range systemVars { 195 vars.sysVarVals[sysVar.Name] = sql.SystemVarValue{ 196 Var: sysVar, 197 Val: sysVar.Default, 198 } 199 } 200 sql.SystemVariables = vars 201 } 202 203 // init initializes SystemVariables as it functions as a global variable. 204 // TODO: get rid of me, make this construction the responsibility of the engine 205 func init() { 206 InitSystemVariables() 207 } 208 209 // systemVars is the internal collection of all MySQL system variables according to the following pages: 210 // https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html 211 // https://dev.mysql.com/doc/refman/8.0/en/replication-options-gtids.html 212 // https://dev.mysql.com/doc/refman/8.0/en/replication-options-source.html 213 var systemVars = map[string]sql.SystemVariable{ 214 "activate_all_roles_on_login": { 215 Name: "activate_all_roles_on_login", 216 Scope: sql.SystemVariableScope_Global, 217 Dynamic: true, 218 SetVarHintApplies: false, 219 Type: types.NewSystemBoolType("activate_all_roles_on_login"), 220 Default: int8(0), 221 }, 222 "admin_address": { 223 Name: "admin_address", 224 Scope: sql.SystemVariableScope_Global, 225 Dynamic: false, 226 SetVarHintApplies: false, 227 Type: types.NewSystemStringType("admin_address"), 228 Default: "", 229 }, 230 "admin_port": { 231 Name: "admin_port", 232 Scope: sql.SystemVariableScope_Global, 233 Dynamic: false, 234 SetVarHintApplies: false, 235 Type: types.NewSystemIntType("admin_port", 0, 65535, false), 236 Default: int64(33062), 237 }, 238 "admin_ssl_ca": { 239 Name: "admin_ssl_ca", 240 Scope: sql.SystemVariableScope_Global, 241 Dynamic: true, 242 SetVarHintApplies: false, 243 Type: types.NewSystemStringType("admin_ssl_ca"), 244 Default: "", 245 }, 246 "admin_ssl_capath": { 247 Name: "admin_ssl_capath", 248 Scope: sql.SystemVariableScope_Global, 249 Dynamic: true, 250 SetVarHintApplies: false, 251 Type: types.NewSystemStringType("admin_ssl_capath"), 252 Default: "", 253 }, 254 "admin_ssl_cert": { 255 Name: "admin_ssl_cert", 256 Scope: sql.SystemVariableScope_Global, 257 Dynamic: true, 258 SetVarHintApplies: false, 259 Type: types.NewSystemStringType("admin_ssl_cert"), 260 Default: "", 261 }, 262 "admin_ssl_cipher": { 263 Name: "admin_ssl_cipher", 264 Scope: sql.SystemVariableScope_Global, 265 Dynamic: true, 266 SetVarHintApplies: false, 267 Type: types.NewSystemStringType("admin_ssl_cipher"), 268 Default: "", 269 }, 270 "admin_ssl_crl": { 271 Name: "admin_ssl_crl", 272 Scope: sql.SystemVariableScope_Global, 273 Dynamic: true, 274 SetVarHintApplies: false, 275 Type: types.NewSystemStringType("admin_ssl_crl"), 276 Default: "", 277 }, 278 "admin_ssl_crlpath": { 279 Name: "admin_ssl_crlpath", 280 Scope: sql.SystemVariableScope_Global, 281 Dynamic: true, 282 SetVarHintApplies: false, 283 Type: types.NewSystemStringType("admin_ssl_crlpath"), 284 Default: "", 285 }, 286 "admin_ssl_key": { 287 Name: "admin_ssl_key", 288 Scope: sql.SystemVariableScope_Global, 289 Dynamic: true, 290 SetVarHintApplies: false, 291 Type: types.NewSystemStringType("admin_ssl_key"), 292 Default: "", 293 }, 294 "admin_tls_ciphersuites": { 295 Name: "admin_tls_ciphersuites", 296 Scope: sql.SystemVariableScope_Global, 297 Dynamic: true, 298 SetVarHintApplies: false, 299 Type: types.NewSystemStringType("admin_tls_ciphersuites"), 300 Default: "", 301 }, 302 "admin_tls_version": { 303 Name: "admin_tls_version", 304 Scope: sql.SystemVariableScope_Global, 305 Dynamic: true, 306 SetVarHintApplies: false, 307 Type: types.NewSystemStringType("admin_tls_version"), 308 Default: "TLSv1,TLSv1.1,TLSv1.2,TLSv1.3", 309 }, 310 "authentication_windows_log_level": { 311 Name: "authentication_windows_log_level", 312 Scope: sql.SystemVariableScope_Global, 313 Dynamic: false, 314 SetVarHintApplies: false, 315 Type: types.NewSystemIntType("authentication_windows_log_level", 0, 4, false), 316 Default: int64(2), 317 }, 318 "authentication_windows_use_principal_name": { 319 Name: "authentication_windows_use_principal_name", 320 Scope: sql.SystemVariableScope_Global, 321 Dynamic: false, 322 SetVarHintApplies: false, 323 Type: types.NewSystemBoolType("authentication_windows_use_principal_name"), 324 Default: int8(1), 325 }, 326 "autocommit": { 327 Name: "autocommit", 328 Scope: sql.SystemVariableScope_Both, 329 Dynamic: true, 330 SetVarHintApplies: false, 331 Type: types.NewSystemBoolType("autocommit"), 332 Default: int8(1), 333 }, 334 "automatic_sp_privileges": { 335 Name: "automatic_sp_privileges", 336 Scope: sql.SystemVariableScope_Global, 337 Dynamic: true, 338 SetVarHintApplies: false, 339 Type: types.NewSystemBoolType("automatic_sp_privileges"), 340 Default: int8(1), 341 }, 342 "auto_generate_certs": { 343 Name: "auto_generate_certs", 344 Scope: sql.SystemVariableScope_Global, 345 Dynamic: false, 346 SetVarHintApplies: false, 347 Type: types.NewSystemBoolType("auto_generate_certs"), 348 Default: int8(1), 349 }, 350 "auto_increment_increment": { 351 Name: "auto_increment_increment", 352 Scope: sql.SystemVariableScope_Both, 353 Dynamic: true, 354 SetVarHintApplies: true, 355 Type: types.NewSystemIntType("auto_increment_increment", 1, 65535, false), 356 Default: int64(1), 357 }, 358 "auto_increment_offset": { 359 Name: "auto_increment_offset", 360 Scope: sql.SystemVariableScope_Both, 361 Dynamic: true, 362 SetVarHintApplies: true, 363 Type: types.NewSystemIntType("auto_increment_offset", 1, 65535, false), 364 Default: int64(1), 365 }, 366 "avoid_temporal_upgrade": { 367 Name: "avoid_temporal_upgrade", 368 Scope: sql.SystemVariableScope_Global, 369 Dynamic: true, 370 SetVarHintApplies: false, 371 Type: types.NewSystemBoolType("avoid_temporal_upgrade"), 372 Default: int8(0), 373 }, 374 "back_log": { 375 Name: "back_log", 376 Scope: sql.SystemVariableScope_Global, 377 Dynamic: false, 378 SetVarHintApplies: false, 379 Type: types.NewSystemIntType("back_log", 1, 65535, true), 380 Default: int64(-1), 381 }, 382 // TODO: add to dolt 383 "basedir": { 384 Name: "basedir", 385 Scope: sql.SystemVariableScope_Global, 386 Dynamic: false, 387 SetVarHintApplies: false, 388 Type: types.NewSystemStringType("basedir"), 389 Default: "", 390 }, 391 "big_tables": { 392 Name: "big_tables", 393 Scope: sql.SystemVariableScope_Both, 394 Dynamic: true, 395 SetVarHintApplies: false, 396 Type: types.NewSystemBoolType("big_tables"), 397 Default: int8(0), 398 }, 399 "bind_address": { 400 Name: "bind_address", 401 Scope: sql.SystemVariableScope_Global, 402 Dynamic: false, 403 SetVarHintApplies: false, 404 Type: types.NewSystemStringType("bind_address"), 405 Default: "*", 406 }, 407 "binlog_gtid_simple_recovery": { 408 Name: "binlog_gtid_simple_recovery", 409 Scope: sql.SystemVariableScope_Global, 410 Dynamic: false, 411 SetVarHintApplies: false, 412 Type: types.NewSystemBoolType("binlog_gtid_simple_recovery"), 413 Default: int8(1), 414 }, 415 "block_encryption_mode": { 416 Name: "block_encryption_mode", 417 Scope: sql.SystemVariableScope_Both, 418 Dynamic: true, 419 SetVarHintApplies: false, 420 Type: types.NewSystemStringType("block_encryption_mode"), 421 Default: "aes-128-ecb", 422 }, 423 "bulk_insert_buffer_size": { 424 Name: "bulk_insert_buffer_size", 425 Scope: sql.SystemVariableScope_Both, 426 Dynamic: true, 427 SetVarHintApplies: true, 428 Type: types.NewSystemUintType("bulk_insert_buffer_size", 0, 18446744073709551615), 429 Default: uint64(8388608), 430 }, 431 "caching_sha2_password_digest_rounds": { 432 Name: "caching_sha2_password_digest_rounds", 433 Scope: sql.SystemVariableScope_Global, 434 Dynamic: false, 435 SetVarHintApplies: false, 436 Type: types.NewSystemIntType("caching_sha2_password_digest_rounds", 5000, 4095000, false), 437 Default: int64(5000), 438 }, 439 "caching_sha2_password_auto_generate_rsa_keys": { 440 Name: "caching_sha2_password_auto_generate_rsa_keys", 441 Scope: sql.SystemVariableScope_Global, 442 Dynamic: false, 443 SetVarHintApplies: false, 444 Type: types.NewSystemBoolType("caching_sha2_password_auto_generate_rsa_keys"), 445 Default: int8(1), 446 }, 447 "caching_sha2_password_private_key_path": { 448 Name: "caching_sha2_password_private_key_path", 449 Scope: sql.SystemVariableScope_Global, 450 Dynamic: false, 451 SetVarHintApplies: false, 452 Type: types.NewSystemStringType("caching_sha2_password_private_key_path"), 453 Default: "private_key.pem", 454 }, 455 "caching_sha2_password_public_key_path": { 456 Name: "caching_sha2_password_public_key_path", 457 Scope: sql.SystemVariableScope_Global, 458 Dynamic: false, 459 SetVarHintApplies: false, 460 Type: types.NewSystemStringType("caching_sha2_password_public_key_path"), 461 Default: "public_key.pem", 462 }, 463 "character_set_client": { 464 Name: "character_set_client", 465 Scope: sql.SystemVariableScope_Both, 466 Dynamic: true, 467 SetVarHintApplies: false, 468 Type: types.NewSystemStringType("character_set_client"), 469 Default: sql.Collation_Default.CharacterSet().String(), 470 NotifyChanged: validateCharacterSet, 471 }, 472 "character_set_connection": { 473 Name: "character_set_connection", 474 Scope: sql.SystemVariableScope_Both, 475 Dynamic: true, 476 SetVarHintApplies: false, 477 Type: types.NewSystemStringType("character_set_connection"), 478 Default: sql.Collation_Default.CharacterSet().String(), 479 NotifyChanged: validateCharacterSet, 480 }, 481 "character_set_database": { 482 Name: "character_set_database", 483 Scope: sql.SystemVariableScope_Both, 484 Dynamic: true, 485 SetVarHintApplies: false, 486 Type: types.NewSystemStringType("character_set_database"), 487 Default: sql.Collation_Default.CharacterSet().String(), 488 NotifyChanged: validateCharacterSet, 489 }, 490 "character_set_filesystem": { 491 Name: "character_set_filesystem", 492 Scope: sql.SystemVariableScope_Both, 493 Dynamic: true, 494 SetVarHintApplies: false, 495 Type: types.NewSystemStringType("character_set_filesystem"), 496 Default: "binary", 497 NotifyChanged: validateCharacterSet, 498 }, 499 "character_set_results": { 500 Name: "character_set_results", 501 Scope: sql.SystemVariableScope_Both, 502 Dynamic: true, 503 SetVarHintApplies: false, 504 Type: types.NewSystemStringType("character_set_results"), 505 Default: sql.Collation_Default.CharacterSet().String(), 506 NotifyChanged: validateCharacterSet, 507 }, 508 "character_set_server": { 509 Name: "character_set_server", 510 Scope: sql.SystemVariableScope_Both, 511 Dynamic: true, 512 SetVarHintApplies: false, 513 Type: types.NewSystemStringType("character_set_server"), 514 Default: sql.Collation_Default.CharacterSet().String(), 515 NotifyChanged: validateCharacterSet, 516 }, 517 "character_set_system": { 518 Name: "character_set_system", 519 Scope: sql.SystemVariableScope_Global, 520 Dynamic: false, 521 SetVarHintApplies: false, 522 Type: types.NewSystemStringType("character_set_system"), 523 Default: sql.Collation_Default.CharacterSet().String(), 524 NotifyChanged: validateCharacterSet, 525 }, 526 "character_sets_dir": { 527 Name: "character_sets_dir", 528 Scope: sql.SystemVariableScope_Global, 529 Dynamic: false, 530 SetVarHintApplies: false, 531 Type: types.NewSystemStringType("character_sets_dir"), 532 Default: "", 533 }, 534 "check_proxy_users": { 535 Name: "check_proxy_users", 536 Scope: sql.SystemVariableScope_Global, 537 Dynamic: true, 538 SetVarHintApplies: false, 539 Type: types.NewSystemBoolType("check_proxy_users"), 540 Default: int8(0), 541 }, 542 "collation_connection": { 543 Name: "collation_connection", 544 Scope: sql.SystemVariableScope_Both, 545 Dynamic: true, 546 SetVarHintApplies: false, 547 Type: types.NewSystemStringType("collation_connection"), 548 Default: sql.Collation_Default.String(), 549 NotifyChanged: validateCollation, 550 }, 551 "collation_database": { 552 Name: "collation_database", 553 Scope: sql.SystemVariableScope_Both, 554 Dynamic: true, 555 SetVarHintApplies: false, 556 Type: types.NewSystemStringType("collation_database"), 557 Default: sql.Collation_Default.String(), 558 NotifyChanged: validateCollation, 559 }, 560 "collation_server": { 561 Name: "collation_server", 562 Scope: sql.SystemVariableScope_Both, 563 Dynamic: true, 564 SetVarHintApplies: false, 565 Type: types.NewSystemStringType("collation_server"), 566 Default: sql.Collation_Default.String(), 567 NotifyChanged: validateCollation, 568 }, 569 "completion_type": { 570 Name: "completion_type", 571 Scope: sql.SystemVariableScope_Both, 572 Dynamic: true, 573 SetVarHintApplies: false, 574 Type: types.NewSystemEnumType("completion_type", "NO_CHAIN", "CHAIN", "RELEASE"), 575 Default: "NO_CHAIN", 576 }, 577 "concurrent_insert": { 578 Name: "concurrent_insert", 579 Scope: sql.SystemVariableScope_Global, 580 Dynamic: true, 581 SetVarHintApplies: false, 582 Type: types.NewSystemEnumType("concurrent_insert", "NEVER", "AUTO", "ALWAYS"), 583 Default: "AUTO", 584 }, 585 "connect_timeout": { 586 Name: "connect_timeout", 587 Scope: sql.SystemVariableScope_Global, 588 Dynamic: true, 589 SetVarHintApplies: false, 590 Type: types.NewSystemIntType("connect_timeout", 2, 31536000, false), 591 Default: int64(10), 592 }, 593 "core_file": { 594 Name: "core_file", 595 Scope: sql.SystemVariableScope_Global, 596 Dynamic: false, 597 SetVarHintApplies: false, 598 Type: types.NewSystemBoolType("core_file"), 599 Default: int8(0), 600 }, 601 "create_admin_listener_thread": { 602 Name: "create_admin_listener_thread", 603 Scope: sql.SystemVariableScope_Global, 604 Dynamic: false, 605 SetVarHintApplies: false, 606 Type: types.NewSystemBoolType("create_admin_listener_thread"), 607 Default: int8(0), 608 }, 609 "cte_max_recursion_depth": { 610 Name: "cte_max_recursion_depth", 611 Scope: sql.SystemVariableScope_Both, 612 Dynamic: true, 613 SetVarHintApplies: false, 614 Type: types.NewSystemIntType("cte_max_recursion_depth", 0, 4294967295, false), 615 Default: int64(1000), 616 }, 617 "datadir": { 618 Name: "datadir", 619 Scope: sql.SystemVariableScope_Global, 620 Dynamic: false, 621 SetVarHintApplies: false, 622 Type: types.NewSystemStringType("datadir"), 623 Default: "", 624 }, 625 "debug_sync": { 626 Name: "debug_sync", 627 Scope: sql.SystemVariableScope_Session, 628 Dynamic: true, 629 SetVarHintApplies: false, 630 Type: types.NewSystemStringType("debug_sync"), 631 Default: "", 632 }, 633 "default_authentication_plugin": { 634 Name: "default_authentication_plugin", 635 Scope: sql.SystemVariableScope_Global, 636 Dynamic: false, 637 SetVarHintApplies: false, 638 Type: types.NewSystemEnumType("default_authentication_plugin", "mysql_native_password", "sha256_password", "caching_sha2_password"), 639 Default: "caching_sha2_password", 640 }, 641 "default_collation_for_utf8mb4": { 642 Name: "default_collation_for_utf8mb4", 643 Scope: sql.SystemVariableScope_Both, 644 Dynamic: true, 645 SetVarHintApplies: false, 646 Type: types.NewSystemEnumType("default_collation_for_utf8mb4", "utf8mb4_0900_ai_ci", "utf8mb4_general_ci"), 647 Default: "utf8mb4_0900_ai_ci", 648 }, 649 "default_password_lifetime": { 650 Name: "default_password_lifetime", 651 Scope: sql.SystemVariableScope_Global, 652 Dynamic: true, 653 SetVarHintApplies: false, 654 Type: types.NewSystemIntType("default_password_lifetime", 0, 65535, false), 655 Default: int64(0), 656 }, 657 "default_storage_engine": { 658 Name: "default_storage_engine", 659 Scope: sql.SystemVariableScope_Both, 660 Dynamic: true, 661 SetVarHintApplies: false, 662 Type: types.NewSystemEnumType("default_storage_engine", "MEMORY", "MRG_MYISAM", "CSV", "FEDERATED", "PERFORMANCE_SCHEMA", "MyISAM", "InnoDB", "BLACKHOLE", "ARCHIVE"), 663 Default: "InnoDB", 664 }, 665 "default_table_encryption": { 666 Name: "default_table_encryption", 667 Scope: sql.SystemVariableScope_Both, 668 Dynamic: true, 669 SetVarHintApplies: true, 670 Type: types.NewSystemBoolType("default_table_encryption"), 671 Default: int8(0), 672 }, 673 "default_tmp_storage_engine": { 674 Name: "default_tmp_storage_engine", 675 Scope: sql.SystemVariableScope_Both, 676 Dynamic: true, 677 SetVarHintApplies: true, 678 Type: types.NewSystemEnumType("default_tmp_storage_engine", "MEMORY", "MRG_MYISAM", "CSV", "FEDERATED", "PERFORMANCE_SCHEMA", "MyISAM", "InnoDB", "BLACKHOLE", "ARCHIVE"), 679 Default: "InnoDB", 680 }, 681 "default_week_format": { 682 Name: "default_week_format", 683 Scope: sql.SystemVariableScope_Both, 684 Dynamic: true, 685 SetVarHintApplies: false, 686 Type: types.NewSystemIntType("default_week_format", 0, 7, false), 687 Default: int64(0), 688 }, 689 "delay_key_write": { 690 Name: "delay_key_write", 691 Scope: sql.SystemVariableScope_Global, 692 Dynamic: true, 693 SetVarHintApplies: false, 694 Type: types.NewSystemEnumType("delay_key_write", "ON", "OFF", "ALL"), 695 Default: "ON", 696 }, 697 "delayed_insert_limit": { 698 Name: "delayed_insert_limit", 699 Scope: sql.SystemVariableScope_Global, 700 Dynamic: true, 701 SetVarHintApplies: false, 702 Type: types.NewSystemUintType("delayed_insert_limit", 1, 18446744073709551615), 703 Default: uint64(100), 704 }, 705 "delayed_insert_timeout": { 706 Name: "delayed_insert_timeout", 707 Scope: sql.SystemVariableScope_Global, 708 Dynamic: true, 709 SetVarHintApplies: false, 710 Type: types.NewSystemIntType("delayed_insert_timeout", -9223372036854775808, 9223372036854775807, false), 711 Default: int64(300), 712 }, 713 "delayed_queue_size": { 714 Name: "delayed_queue_size", 715 Scope: sql.SystemVariableScope_Global, 716 Dynamic: true, 717 SetVarHintApplies: false, 718 Type: types.NewSystemUintType("delayed_queue_size", 1, 18446744073709551615), 719 Default: uint64(1000), 720 }, 721 "disabled_storage_engines": { 722 Name: "disabled_storage_engines", 723 Scope: sql.SystemVariableScope_Global, 724 Dynamic: false, 725 SetVarHintApplies: false, 726 Type: types.NewSystemStringType("disabled_storage_engines"), 727 Default: "", 728 }, 729 "disconnect_on_expired_password": { 730 Name: "disconnect_on_expired_password", 731 Scope: sql.SystemVariableScope_Global, 732 Dynamic: false, 733 SetVarHintApplies: false, 734 Type: types.NewSystemBoolType("disconnect_on_expired_password"), 735 Default: int8(1), 736 }, 737 "div_precision_increment": { 738 Name: "div_precision_increment", 739 Scope: sql.SystemVariableScope_Both, 740 Dynamic: true, 741 SetVarHintApplies: true, 742 Type: types.NewSystemIntType("div_precision_increment", 0, 30, false), 743 Default: int64(4), 744 }, 745 "dragnet.log_error_filter_rules": { 746 Name: "dragnet.log_error_filter_rules", 747 Scope: sql.SystemVariableScope_Global, 748 Dynamic: true, 749 SetVarHintApplies: false, 750 Type: types.NewSystemStringType("dragnet.log_error_filter_rules"), 751 Default: "drop", 752 }, 753 "end_markers_in_json": { 754 Name: "end_markers_in_json", 755 Scope: sql.SystemVariableScope_Both, 756 Dynamic: true, 757 SetVarHintApplies: true, 758 Type: types.NewSystemBoolType("end_markers_in_json"), 759 Default: int8(0), 760 }, 761 "enforce_gtid_consistency": { 762 Name: "enforce_gtid_consistency", 763 Scope: sql.SystemVariableScope_Global, 764 Dynamic: true, 765 SetVarHintApplies: false, 766 Type: types.NewSystemEnumType("enforce_gtid_consistency", "OFF", "ON", "WARN"), 767 Default: "OFF", 768 }, 769 "eq_range_index_dive_limit": { 770 Name: "eq_range_index_dive_limit", 771 Scope: sql.SystemVariableScope_Both, 772 Dynamic: true, 773 SetVarHintApplies: true, 774 Type: types.NewSystemIntType("eq_range_index_dive_limit", 0, 4294967295, false), 775 Default: int64(200), 776 }, 777 "event_scheduler": { 778 Name: "event_scheduler", 779 Scope: sql.SystemVariableScope_Global, 780 Dynamic: true, 781 SetVarHintApplies: false, 782 Type: types.NewSystemEnumType("event_scheduler", "ON", "OFF", "DISABLED"), 783 Default: "ON", 784 NotifyChanged: func(scope sql.SystemVariableScope, value sql.SystemVarValue) error { 785 convertedVal, _, err := value.Var.Type.Convert(value.Val) 786 if err == nil { 787 // TODO: need to update EventScheduler state at runtime if applicable 788 s := strings.ToLower(convertedVal.(string)) 789 switch s { 790 case "on", "1": 791 // need access to valid analyzer and ctx to call eventscheduler.TurnOnEventScheduler() 792 case "off", "0": 793 // need to call eventscheduler.TurnOffEventScheduler() 794 default: 795 return fmt.Errorf("variable 'event_scheduler' can't be set to the value '%s'", s) 796 } 797 } 798 return nil 799 }, 800 }, 801 "explicit_defaults_for_timestamp": { 802 Name: "explicit_defaults_for_timestamp", 803 Scope: sql.SystemVariableScope_Both, 804 Dynamic: true, 805 SetVarHintApplies: false, 806 Type: types.NewSystemBoolType("explicit_defaults_for_timestamp"), 807 Default: int8(1), 808 }, 809 "external_user": { 810 Name: "external_user", 811 Scope: sql.SystemVariableScope_Session, 812 Dynamic: false, 813 SetVarHintApplies: false, 814 Type: types.NewSystemStringType("external_user"), 815 Default: "", 816 }, 817 "flush": { 818 Name: "flush", 819 Scope: sql.SystemVariableScope_Global, 820 Dynamic: true, 821 SetVarHintApplies: false, 822 Type: types.NewSystemBoolType("flush"), 823 Default: int8(0), 824 }, 825 "flush_time": { 826 Name: "flush_time", 827 Scope: sql.SystemVariableScope_Global, 828 Dynamic: true, 829 SetVarHintApplies: false, 830 Type: types.NewSystemIntType("flush_time", 0, 9223372036854775807, false), 831 Default: int64(0), 832 }, 833 "foreign_key_checks": { 834 Name: "foreign_key_checks", 835 Scope: sql.SystemVariableScope_Both, 836 Dynamic: true, 837 SetVarHintApplies: true, 838 Type: types.NewSystemBoolType("foreign_key_checks"), 839 Default: int8(1), 840 }, 841 "ft_boolean_syntax": { 842 Name: "ft_boolean_syntax", 843 Scope: sql.SystemVariableScope_Global, 844 Dynamic: true, 845 SetVarHintApplies: false, 846 Type: types.NewSystemStringType("ft_boolean_syntax"), 847 Default: `+ -><()~*:""&|`, 848 }, 849 "ft_max_word_len": { 850 Name: "ft_max_word_len", 851 Scope: sql.SystemVariableScope_Global, 852 Dynamic: false, 853 SetVarHintApplies: false, 854 Type: types.NewSystemIntType("ft_max_word_len", 10, 9223372036854775807, false), 855 Default: int64(0), 856 }, 857 "ft_min_word_len": { 858 Name: "ft_min_word_len", 859 Scope: sql.SystemVariableScope_Global, 860 Dynamic: false, 861 SetVarHintApplies: false, 862 Type: types.NewSystemIntType("ft_min_word_len", 1, 9223372036854775807, false), 863 Default: int64(4), 864 }, 865 "ft_query_expansion_limit": { 866 Name: "ft_query_expansion_limit", 867 Scope: sql.SystemVariableScope_Global, 868 Dynamic: false, 869 SetVarHintApplies: false, 870 Type: types.NewSystemIntType("ft_query_expansion_limit", 0, 1000, false), 871 Default: int64(20), 872 }, 873 "ft_stopword_file": { 874 Name: "ft_stopword_file", 875 Scope: sql.SystemVariableScope_Global, 876 Dynamic: false, 877 SetVarHintApplies: false, 878 Type: types.NewSystemStringType("ft_stopword_file"), 879 Default: "", 880 }, 881 "general_log": { 882 Name: "general_log", 883 Scope: sql.SystemVariableScope_Global, 884 Dynamic: true, 885 SetVarHintApplies: false, 886 Type: types.NewSystemBoolType("general_log"), 887 Default: int8(0), 888 }, 889 "general_log_file": { 890 Name: "general_log_file", 891 Scope: sql.SystemVariableScope_Global, 892 Dynamic: true, 893 SetVarHintApplies: false, 894 Type: types.NewSystemStringType("general_log_file"), 895 Default: "host_name.log", 896 }, 897 "generated_random_password_length": { 898 Name: "generated_random_password_length", 899 Scope: sql.SystemVariableScope_Both, 900 Dynamic: true, 901 SetVarHintApplies: false, 902 Type: types.NewSystemIntType("generated_random_password_length", 5, 255, false), 903 Default: int64(20), 904 }, 905 "group_concat_max_len": { 906 Name: "group_concat_max_len", 907 Scope: sql.SystemVariableScope_Both, 908 Dynamic: true, 909 SetVarHintApplies: true, 910 Type: types.NewSystemUintType("group_concat_max_len", 4, 18446744073709551615), 911 Default: uint64(1024), 912 }, 913 "gtid_executed": { 914 Name: "gtid_executed", 915 Scope: sql.SystemVariableScope_Global, 916 Dynamic: false, 917 SetVarHintApplies: false, 918 Type: types.NewSystemStringType("gtid_executed"), 919 Default: "", 920 }, 921 "gtid_executed_compression_period": { 922 Name: "gtid_executed_compression_period", 923 Scope: sql.SystemVariableScope_Global, 924 Dynamic: true, 925 SetVarHintApplies: false, 926 Type: types.NewSystemIntType("gtid_executed_compression_period", 0, 4294967295, false), 927 Default: int64(0), 928 }, 929 "gtid_mode": { 930 Name: "gtid_mode", 931 Scope: sql.SystemVariableScope_Global, 932 Dynamic: true, 933 SetVarHintApplies: false, 934 Type: types.NewSystemEnumType("gtid_mode", "OFF", "OFF_PERMISSIVE", "ON_PERMISSIVE", "ON"), 935 Default: "OFF", 936 }, 937 "gtid_next": { 938 Name: "gtid_next", 939 Scope: sql.SystemVariableScope_Session, 940 Dynamic: true, 941 SetVarHintApplies: false, 942 Type: types.NewSystemEnumType("gtid_next", "AUTOMATIC", "ANONYMOUS", "UUID:NUMBER"), 943 Default: "AUTOMATIC", 944 }, 945 "gtid_owned": { 946 Name: "gtid_owned", 947 Scope: sql.SystemVariableScope_Both, 948 Dynamic: false, 949 SetVarHintApplies: false, 950 Type: types.NewSystemStringType("gtid_owned"), 951 Default: "", 952 }, 953 "gtid_purged": { 954 Name: "gtid_purged", 955 Scope: sql.SystemVariableScope_Global, 956 Dynamic: true, 957 SetVarHintApplies: false, 958 Type: types.NewSystemStringType("gtid_purged"), 959 Default: "", 960 }, 961 "have_statement_timeout": { 962 Name: "have_statement_timeout", 963 Scope: sql.SystemVariableScope_Global, 964 Dynamic: false, 965 SetVarHintApplies: false, 966 Type: types.NewSystemBoolType("have_statement_timeout"), 967 Default: int8(0), 968 }, 969 "histogram_generation_max_mem_size": { 970 Name: "histogram_generation_max_mem_size", 971 Scope: sql.SystemVariableScope_Both, 972 Dynamic: true, 973 SetVarHintApplies: false, 974 Type: types.NewSystemUintType("histogram_generation_max_mem_size", 1000000, 18446744073709551615), 975 Default: uint64(20000000), 976 }, 977 "host_cache_size": { 978 Name: "host_cache_size", 979 Scope: sql.SystemVariableScope_Global, 980 Dynamic: true, 981 SetVarHintApplies: false, 982 Type: types.NewSystemIntType("host_cache_size", 0, 65536, true), 983 Default: int64(-1), 984 }, 985 "hostname": { 986 Name: "hostname", 987 Scope: sql.SystemVariableScope_Global, 988 Dynamic: false, 989 SetVarHintApplies: false, 990 Type: types.NewSystemStringType("hostname"), 991 Default: "", 992 }, 993 "immediate_server_version": { 994 Name: "immediate_server_version", 995 Scope: sql.SystemVariableScope_Session, 996 Dynamic: true, 997 SetVarHintApplies: false, 998 Type: types.NewSystemIntType("immediate_server_version", -9223372036854775808, 9223372036854775807, false), 999 Default: int64(80017), 1000 }, 1001 "init_connect": { 1002 Name: "init_connect", 1003 Scope: sql.SystemVariableScope_Global, 1004 Dynamic: true, 1005 SetVarHintApplies: false, 1006 Type: types.NewSystemStringType("init_connect"), 1007 Default: "", 1008 }, 1009 "information_schema_stats_expiry": { 1010 Name: "information_schema_stats_expiry", 1011 Scope: sql.SystemVariableScope_Both, 1012 Dynamic: true, 1013 SetVarHintApplies: false, 1014 Type: types.NewSystemIntType("information_schema_stats_expiry", 0, 31536000, false), 1015 Default: int64(86400), 1016 }, 1017 "init_file": { 1018 Name: "init_file", 1019 Scope: sql.SystemVariableScope_Global, 1020 Dynamic: false, 1021 SetVarHintApplies: false, 1022 Type: types.NewSystemStringType("init_file"), 1023 Default: "", 1024 }, 1025 "inmemory_joins": { 1026 Name: "inmemory_joins", 1027 Scope: sql.SystemVariableScope_Session, 1028 Dynamic: true, 1029 SetVarHintApplies: false, 1030 Type: types.NewSystemBoolType("inmemory_joins"), 1031 Default: int8(0), 1032 }, 1033 // Row locking is currently not supported. This variable is provided for 3p tools, and we always return the 1034 // Lowest value allowed by MySQL, which is 1. If you attempt to set this value to anything other than 1, errors ensue. 1035 "innodb_lock_wait_timeout": { 1036 Name: "innodb_lock_wait_timeout", 1037 Scope: sql.SystemVariableScope_Global, 1038 Dynamic: true, 1039 SetVarHintApplies: false, 1040 Type: types.NewSystemIntType("innodb_lock_wait_timeout", 1, 1, false), 1041 Default: int64(1), 1042 }, 1043 "innodb_stats_auto_recalc": { 1044 Name: "innodb_stats_auto_recalc", 1045 Scope: sql.SystemVariableScope_Global, 1046 Dynamic: true, 1047 SetVarHintApplies: false, 1048 Type: types.NewSystemBoolType("innodb_stats_auto_recalc"), 1049 Default: int8(1), 1050 }, 1051 "interactive_timeout": { 1052 Name: "interactive_timeout", 1053 Scope: sql.SystemVariableScope_Both, 1054 Dynamic: true, 1055 SetVarHintApplies: false, 1056 Type: types.NewSystemIntType("interactive_timeout", 1, 9223372036854775807, false), 1057 Default: int64(28800), 1058 }, 1059 "internal_tmp_disk_storage_engine": { 1060 Name: "internal_tmp_disk_storage_engine", 1061 Scope: sql.SystemVariableScope_Global, 1062 Dynamic: true, 1063 SetVarHintApplies: false, 1064 Type: types.NewSystemEnumType("internal_tmp_disk_storage_engine", "MYISAM", "INNODB"), 1065 Default: "INNODB", 1066 }, 1067 "internal_tmp_mem_storage_engine": { 1068 Name: "internal_tmp_mem_storage_engine", 1069 Scope: sql.SystemVariableScope_Both, 1070 Dynamic: true, 1071 SetVarHintApplies: true, 1072 Type: types.NewSystemEnumType("internal_tmp_mem_storage_engine", "TempTable", "MEMORY"), 1073 Default: "TempTable", 1074 }, 1075 "join_buffer_size": { 1076 Name: "join_buffer_size", 1077 Scope: sql.SystemVariableScope_Both, 1078 Dynamic: true, 1079 SetVarHintApplies: true, 1080 Type: types.NewSystemUintType("join_buffer_size", 128, 18446744073709547520), 1081 Default: uint64(262144), 1082 }, 1083 "join_complexity_limit": { 1084 Name: "join_complexity_limit", 1085 Scope: sql.SystemVariableScope_Both, 1086 Dynamic: true, 1087 SetVarHintApplies: true, 1088 Type: types.NewSystemUintType("join_complexity_limit", 2, 20), 1089 Default: uint64(12), 1090 }, 1091 "keep_files_on_create": { 1092 Name: "keep_files_on_create", 1093 Scope: sql.SystemVariableScope_Both, 1094 Dynamic: true, 1095 SetVarHintApplies: false, 1096 Type: types.NewSystemBoolType("keep_files_on_create"), 1097 Default: int8(0), 1098 }, 1099 "key_buffer_size": { 1100 Name: "key_buffer_size", 1101 Scope: sql.SystemVariableScope_Global, 1102 Dynamic: true, 1103 SetVarHintApplies: false, 1104 Type: types.NewSystemUintType("key_buffer_size", 8, 18446744073709551615), 1105 Default: uint64(8388608), 1106 }, 1107 "key_cache_age_threshold": { 1108 Name: "key_cache_age_threshold", 1109 Scope: sql.SystemVariableScope_Global, 1110 Dynamic: true, 1111 SetVarHintApplies: false, 1112 Type: types.NewSystemUintType("key_cache_age_threshold", 100, 18446744073709551615), 1113 Default: uint64(300), 1114 }, 1115 "key_cache_block_size": { 1116 Name: "key_cache_block_size", 1117 Scope: sql.SystemVariableScope_Global, 1118 Dynamic: true, 1119 SetVarHintApplies: false, 1120 Type: types.NewSystemIntType("key_cache_block_size", 512, 16384, false), 1121 Default: int64(1024), 1122 }, 1123 "key_cache_division_limit": { 1124 Name: "key_cache_division_limit", 1125 Scope: sql.SystemVariableScope_Global, 1126 Dynamic: true, 1127 SetVarHintApplies: false, 1128 Type: types.NewSystemIntType("key_cache_division_limit", 1, 100, false), 1129 Default: int64(100), 1130 }, 1131 "large_files_support": { 1132 Name: "large_files_support", 1133 Scope: sql.SystemVariableScope_Global, 1134 Dynamic: false, 1135 SetVarHintApplies: false, 1136 Type: types.NewSystemBoolType("large_files_support"), 1137 Default: int8(0), 1138 }, 1139 "large_pages": { 1140 Name: "large_pages", 1141 Scope: sql.SystemVariableScope_Global, 1142 Dynamic: false, 1143 SetVarHintApplies: false, 1144 Type: types.NewSystemBoolType("large_pages"), 1145 Default: int8(0), 1146 }, 1147 "large_page_size": { 1148 Name: "large_page_size", 1149 Scope: sql.SystemVariableScope_Global, 1150 Dynamic: false, 1151 SetVarHintApplies: false, 1152 Type: types.NewSystemIntType("large_page_size", -9223372036854775808, 9223372036854775807, false), 1153 Default: int64(0), 1154 }, 1155 "last_insert_id": { 1156 Name: "last_insert_id", 1157 Scope: sql.SystemVariableScope_Session, 1158 Dynamic: true, 1159 SetVarHintApplies: false, 1160 Type: types.NewSystemIntType("last_insert_id", -9223372036854775808, 9223372036854775807, false), 1161 Default: int64(0), 1162 }, 1163 "lc_messages": { 1164 Name: "lc_messages", 1165 Scope: sql.SystemVariableScope_Both, 1166 Dynamic: true, 1167 SetVarHintApplies: false, 1168 Type: types.NewSystemStringType("lc_messages"), 1169 Default: "en_US", 1170 }, 1171 "lc_messages_dir": { 1172 Name: "lc_messages_dir", 1173 Scope: sql.SystemVariableScope_Global, 1174 Dynamic: false, 1175 SetVarHintApplies: false, 1176 Type: types.NewSystemStringType("lc_messages_dir"), 1177 Default: "", 1178 }, 1179 "lc_time_names": { 1180 Name: "lc_time_names", 1181 Scope: sql.SystemVariableScope_Both, 1182 Dynamic: true, 1183 SetVarHintApplies: false, 1184 Type: types.NewSystemStringType("lc_time_names"), 1185 Default: "", 1186 }, 1187 "license": { 1188 Name: "license", 1189 Scope: sql.SystemVariableScope_Global, 1190 Dynamic: false, 1191 SetVarHintApplies: false, 1192 Type: types.NewSystemStringType("license"), 1193 Default: "GPL", 1194 }, 1195 "local_infile": { 1196 Name: "local_infile", 1197 Scope: sql.SystemVariableScope_Global, 1198 Dynamic: true, 1199 SetVarHintApplies: false, 1200 Type: types.NewSystemBoolType("local_infile"), 1201 Default: int8(0), 1202 }, 1203 "lock_wait_timeout": { 1204 Name: "lock_wait_timeout", 1205 Scope: sql.SystemVariableScope_Both, 1206 Dynamic: true, 1207 SetVarHintApplies: true, 1208 Type: types.NewSystemIntType("lock_wait_timeout", 1, 31536000, false), 1209 Default: int64(31536000), 1210 }, 1211 "log_error": { 1212 Name: "log_error", 1213 Scope: sql.SystemVariableScope_Global, 1214 Dynamic: false, 1215 SetVarHintApplies: false, 1216 Type: types.NewSystemStringType("log_error"), 1217 Default: "", 1218 }, 1219 "log_error_services": { 1220 Name: "log_error_services", 1221 Scope: sql.SystemVariableScope_Global, 1222 Dynamic: true, 1223 SetVarHintApplies: false, 1224 Type: types.NewSystemStringType("log_error_services"), 1225 Default: "log_filter_internal; log_sink_internal", 1226 }, 1227 "log_error_suppression_list": { 1228 Name: "log_error_suppression_list", 1229 Scope: sql.SystemVariableScope_Global, 1230 Dynamic: true, 1231 SetVarHintApplies: false, 1232 Type: types.NewSystemStringType("log_error_suppression_list"), 1233 Default: "", 1234 }, 1235 "log_error_verbosity": { 1236 Name: "log_error_verbosity", 1237 Scope: sql.SystemVariableScope_Global, 1238 Dynamic: true, 1239 SetVarHintApplies: false, 1240 Type: types.NewSystemIntType("log_error_verbosity", 1, 3, false), 1241 Default: int64(2), 1242 }, 1243 "log_output": { 1244 Name: "log_output", 1245 Scope: sql.SystemVariableScope_Global, 1246 Dynamic: true, 1247 SetVarHintApplies: false, 1248 Type: types.NewSystemSetType("log_output", "TABLE", "FILE", "NONE"), 1249 Default: "FILE", 1250 }, 1251 "log_queries_not_using_indexes": { 1252 Name: "log_queries_not_using_indexes", 1253 Scope: sql.SystemVariableScope_Global, 1254 Dynamic: true, 1255 SetVarHintApplies: false, 1256 Type: types.NewSystemBoolType("log_queries_not_using_indexes"), 1257 Default: int8(0), 1258 }, 1259 "log_raw": { 1260 Name: "log_raw", 1261 Scope: sql.SystemVariableScope_Global, 1262 Dynamic: true, 1263 SetVarHintApplies: false, 1264 Type: types.NewSystemBoolType("log_raw"), 1265 Default: int8(0), 1266 }, 1267 "log_slow_admin_statements": { 1268 Name: "log_slow_admin_statements", 1269 Scope: sql.SystemVariableScope_Global, 1270 Dynamic: true, 1271 SetVarHintApplies: false, 1272 Type: types.NewSystemBoolType("log_slow_admin_statements"), 1273 Default: int8(0), 1274 }, 1275 "log_slow_extra": { 1276 Name: "log_slow_extra", 1277 Scope: sql.SystemVariableScope_Global, 1278 Dynamic: true, 1279 SetVarHintApplies: false, 1280 Type: types.NewSystemBoolType("log_slow_extra"), 1281 Default: int8(0), 1282 }, 1283 "log_syslog": { 1284 Name: "log_syslog", 1285 Scope: sql.SystemVariableScope_Global, 1286 Dynamic: true, 1287 SetVarHintApplies: false, 1288 Type: types.NewSystemBoolType("log_syslog"), 1289 Default: int8(1), 1290 }, 1291 "log_syslog_facility": { 1292 Name: "log_syslog_facility", 1293 Scope: sql.SystemVariableScope_Global, 1294 Dynamic: true, 1295 SetVarHintApplies: false, 1296 Type: types.NewSystemStringType("log_syslog_facility"), 1297 Default: "daemon", 1298 }, 1299 "log_syslog_include_pid": { 1300 Name: "log_syslog_include_pid", 1301 Scope: sql.SystemVariableScope_Global, 1302 Dynamic: true, 1303 SetVarHintApplies: false, 1304 Type: types.NewSystemBoolType("log_syslog_include_pid"), 1305 Default: int8(1), 1306 }, 1307 "log_syslog_tag": { 1308 Name: "log_syslog_tag", 1309 Scope: sql.SystemVariableScope_Global, 1310 Dynamic: true, 1311 SetVarHintApplies: false, 1312 Type: types.NewSystemStringType("log_syslog_tag"), 1313 Default: "", 1314 }, 1315 "log_timestamps": { 1316 Name: "log_timestamps", 1317 Scope: sql.SystemVariableScope_Global, 1318 Dynamic: true, 1319 SetVarHintApplies: false, 1320 Type: types.NewSystemEnumType("log_timestamps", "UTC", "SYSTEM"), 1321 Default: "UTC", 1322 }, 1323 "log_throttle_queries_not_using_indexes": { 1324 Name: "log_throttle_queries_not_using_indexes", 1325 Scope: sql.SystemVariableScope_Global, 1326 Dynamic: true, 1327 SetVarHintApplies: false, 1328 Type: types.NewSystemIntType("log_throttle_queries_not_using_indexes", -9223372036854775808, 9223372036854775807, false), 1329 Default: int64(0), 1330 }, 1331 "long_query_time": { 1332 Name: "long_query_time", 1333 Scope: sql.SystemVariableScope_Both, 1334 Dynamic: true, 1335 SetVarHintApplies: false, 1336 Type: types.NewSystemDoubleType("long_query_time", 0, math.MaxFloat64), 1337 Default: float64(10), 1338 }, 1339 "low_priority_updates": { 1340 Name: "low_priority_updates", 1341 Scope: sql.SystemVariableScope_Both, 1342 Dynamic: true, 1343 SetVarHintApplies: false, 1344 Type: types.NewSystemBoolType("low_priority_updates"), 1345 Default: int8(0), 1346 }, 1347 "lower_case_file_system": { 1348 Name: "lower_case_file_system", 1349 Scope: sql.SystemVariableScope_Global, 1350 Dynamic: false, 1351 SetVarHintApplies: false, 1352 Type: types.NewSystemBoolType("lower_case_file_system"), 1353 Default: int8(0), 1354 }, 1355 "lower_case_table_names": { 1356 Name: "lower_case_table_names", 1357 Scope: sql.SystemVariableScope_Global, 1358 Dynamic: false, 1359 SetVarHintApplies: false, 1360 Type: types.NewSystemIntType("lower_case_table_names", 0, 2, false), 1361 Default: int64(0), 1362 }, 1363 "mandatory_roles": { 1364 Name: "mandatory_roles", 1365 Scope: sql.SystemVariableScope_Global, 1366 Dynamic: true, 1367 SetVarHintApplies: false, 1368 Type: types.NewSystemStringType("mandatory_roles"), 1369 Default: "", 1370 }, 1371 "max_allowed_packet": { 1372 Name: "max_allowed_packet", 1373 Scope: sql.SystemVariableScope_Both, 1374 Dynamic: true, 1375 SetVarHintApplies: false, 1376 Type: types.NewSystemUintType("max_allowed_packet", 1024, 1073741824), 1377 Default: int64(1073741824), 1378 }, 1379 "max_connect_errors": { 1380 Name: "max_connect_errors", 1381 Scope: sql.SystemVariableScope_Global, 1382 Dynamic: true, 1383 SetVarHintApplies: false, 1384 Type: types.NewSystemUintType("max_connect_errors", 1, 18446744073709551615), 1385 Default: uint64(100), 1386 }, 1387 "max_connections": { 1388 Name: "max_connections", 1389 Scope: sql.SystemVariableScope_Global, 1390 Dynamic: true, 1391 SetVarHintApplies: false, 1392 Type: types.NewSystemIntType("max_connections", 1, 100000, false), 1393 Default: int64(151), 1394 }, 1395 "max_delayed_threads": { 1396 Name: "max_delayed_threads", 1397 Scope: sql.SystemVariableScope_Both, 1398 Dynamic: true, 1399 SetVarHintApplies: false, 1400 Type: types.NewSystemIntType("max_delayed_threads", 0, 16384, false), 1401 Default: int64(20), 1402 }, 1403 "max_digest_length": { 1404 Name: "max_digest_length", 1405 Scope: sql.SystemVariableScope_Global, 1406 Dynamic: false, 1407 SetVarHintApplies: false, 1408 Type: types.NewSystemIntType("max_digest_length", 0, 1048576, false), 1409 Default: int64(1024), 1410 }, 1411 "max_error_count": { 1412 Name: "max_error_count", 1413 Scope: sql.SystemVariableScope_Both, 1414 Dynamic: true, 1415 SetVarHintApplies: true, 1416 Type: types.NewSystemIntType("max_error_count", 0, 65535, false), 1417 Default: int64(1024), 1418 }, 1419 "max_execution_time": { 1420 Name: "max_execution_time", 1421 Scope: sql.SystemVariableScope_Both, 1422 Dynamic: true, 1423 SetVarHintApplies: true, 1424 Type: types.NewSystemIntType("max_execution_time", -9223372036854775808, 9223372036854775807, false), 1425 Default: int64(0), 1426 }, 1427 "max_heap_table_size": { 1428 Name: "max_heap_table_size", 1429 Scope: sql.SystemVariableScope_Both, 1430 Dynamic: true, 1431 SetVarHintApplies: true, 1432 Type: types.NewSystemUintType("max_heap_table_size", 16384, 1844674407370954752), 1433 Default: uint64(16777216), 1434 }, 1435 "max_insert_delayed_threads": { 1436 Name: "max_insert_delayed_threads", 1437 Scope: sql.SystemVariableScope_Both, 1438 Dynamic: true, 1439 SetVarHintApplies: false, 1440 Type: types.NewSystemIntType("max_insert_delayed_threads", -9223372036854775808, 9223372036854775807, false), 1441 Default: int64(0), 1442 }, 1443 "max_join_size": { 1444 Name: "max_join_size", 1445 Scope: sql.SystemVariableScope_Both, 1446 Dynamic: true, 1447 SetVarHintApplies: true, 1448 Type: types.NewSystemUintType("max_join_size", 1, 18446744073709551615), 1449 Default: uint64(18446744073709551615), 1450 }, 1451 "max_length_for_sort_data": { 1452 Name: "max_length_for_sort_data", 1453 Scope: sql.SystemVariableScope_Both, 1454 Dynamic: true, 1455 SetVarHintApplies: true, 1456 Type: types.NewSystemIntType("max_length_for_sort_data", 4, 8388608, false), 1457 Default: int64(4096), 1458 }, 1459 "max_points_in_geometry": { 1460 Name: "max_points_in_geometry", 1461 Scope: sql.SystemVariableScope_Both, 1462 Dynamic: true, 1463 SetVarHintApplies: true, 1464 Type: types.NewSystemIntType("max_points_in_geometry", 3, 1048576, false), 1465 Default: int64(65536), 1466 }, 1467 "max_prepared_stmt_count": { 1468 Name: "max_prepared_stmt_count", 1469 Scope: sql.SystemVariableScope_Global, 1470 Dynamic: true, 1471 SetVarHintApplies: false, 1472 Type: types.NewSystemIntType("max_prepared_stmt_count", 0, 4194304, false), 1473 Default: int64(16382), 1474 }, 1475 "max_seeks_for_key": { 1476 Name: "max_seeks_for_key", 1477 Scope: sql.SystemVariableScope_Both, 1478 Dynamic: true, 1479 SetVarHintApplies: true, 1480 Type: types.NewSystemUintType("max_seeks_for_key", 1, 18446744073709551615), 1481 Default: uint64(18446744073709551615), 1482 }, 1483 "max_sort_length": { 1484 Name: "max_sort_length", 1485 Scope: sql.SystemVariableScope_Both, 1486 Dynamic: true, 1487 SetVarHintApplies: true, 1488 Type: types.NewSystemIntType("max_sort_length", 4, 8388608, false), 1489 Default: int64(1024), 1490 }, 1491 "max_sp_recursion_depth": { 1492 Name: "max_sp_recursion_depth", 1493 Scope: sql.SystemVariableScope_Both, 1494 Dynamic: true, 1495 SetVarHintApplies: false, 1496 Type: types.NewSystemIntType("max_sp_recursion_depth", -9223372036854775808, 255, false), 1497 Default: int64(0), 1498 }, 1499 "max_user_connections": { 1500 Name: "max_user_connections", 1501 Scope: sql.SystemVariableScope_Both, 1502 Dynamic: true, 1503 SetVarHintApplies: false, 1504 Type: types.NewSystemIntType("max_user_connections", 0, 4294967295, false), 1505 Default: int64(0), 1506 }, 1507 "max_write_lock_count": { 1508 Name: "max_write_lock_count", 1509 Scope: sql.SystemVariableScope_Global, 1510 Dynamic: true, 1511 SetVarHintApplies: false, 1512 Type: types.NewSystemUintType("max_write_lock_count", 1, 18446744073709551615), 1513 Default: uint64(18446744073709551615), 1514 }, 1515 "mecab_rc_file": { 1516 Name: "mecab_rc_file", 1517 Scope: sql.SystemVariableScope_Global, 1518 Dynamic: false, 1519 SetVarHintApplies: false, 1520 Type: types.NewSystemStringType("mecab_rc_file"), 1521 Default: "", 1522 }, 1523 "metadata_locks_cache_size": { 1524 Name: "metadata_locks_cache_size", 1525 Scope: sql.SystemVariableScope_Global, 1526 Dynamic: false, 1527 SetVarHintApplies: false, 1528 Type: types.NewSystemIntType("metadata_locks_cache_size", 1, 1048576, false), 1529 Default: int64(1024), 1530 }, 1531 "metadata_locks_hash_instances": { 1532 Name: "metadata_locks_hash_instances", 1533 Scope: sql.SystemVariableScope_Global, 1534 Dynamic: false, 1535 SetVarHintApplies: false, 1536 Type: types.NewSystemIntType("metadata_locks_hash_instances", 1, 1024, false), 1537 Default: int64(8), 1538 }, 1539 "min_examined_row_limit": { 1540 Name: "min_examined_row_limit", 1541 Scope: sql.SystemVariableScope_Both, 1542 Dynamic: true, 1543 SetVarHintApplies: false, 1544 Type: types.NewSystemUintType("min_examined_row_limit", 0, 18446744073709551615), 1545 Default: uint64(0), 1546 }, 1547 "myisam_data_pointer_size": { 1548 Name: "myisam_data_pointer_size", 1549 Scope: sql.SystemVariableScope_Global, 1550 Dynamic: true, 1551 SetVarHintApplies: false, 1552 Type: types.NewSystemIntType("myisam_data_pointer_size", 2, 7, false), 1553 Default: int64(6), 1554 }, 1555 "myisam_max_sort_file_size": { 1556 Name: "myisam_max_sort_file_size", 1557 Scope: sql.SystemVariableScope_Global, 1558 Dynamic: true, 1559 SetVarHintApplies: false, 1560 Type: types.NewSystemIntType("myisam_max_sort_file_size", -9223372036854775808, 9223372036853727232, false), 1561 Default: int64(9223372036853727232), 1562 }, 1563 "myisam_mmap_size": { 1564 Name: "myisam_mmap_size", 1565 Scope: sql.SystemVariableScope_Global, 1566 Dynamic: false, 1567 SetVarHintApplies: false, 1568 Type: types.NewSystemUintType("myisam_mmap_size", 7, 18446744073709551615), 1569 Default: uint64(18446744073709551615), 1570 }, 1571 "myisam_recover_options": { 1572 Name: "myisam_recover_options", 1573 Scope: sql.SystemVariableScope_Global, 1574 Dynamic: false, 1575 SetVarHintApplies: false, 1576 Type: types.NewSystemEnumType("myisam_recover_options", "OFF", "DEFAULT", "BACKUP", "FORCE", "QUICK"), 1577 Default: "OFF", 1578 }, 1579 "myisam_repair_threads": { 1580 Name: "myisam_repair_threads", 1581 Scope: sql.SystemVariableScope_Both, 1582 Dynamic: true, 1583 SetVarHintApplies: false, 1584 Type: types.NewSystemUintType("myisam_repair_threads", 1, 18446744073709551615), 1585 Default: uint64(1), 1586 }, 1587 "myisam_sort_buffer_size": { 1588 Name: "myisam_sort_buffer_size", 1589 Scope: sql.SystemVariableScope_Both, 1590 Dynamic: true, 1591 SetVarHintApplies: false, 1592 Type: types.NewSystemUintType("myisam_sort_buffer_size", 4096, 18446744073709551615), 1593 Default: uint64(8388608), 1594 }, 1595 "myisam_stats_method": { 1596 Name: "myisam_stats_method", 1597 Scope: sql.SystemVariableScope_Both, 1598 Dynamic: true, 1599 SetVarHintApplies: false, 1600 Type: types.NewSystemEnumType("myisam_stats_method", "nulls_equal", "nulls_unequal", "nulls_ignored"), 1601 Default: "nulls_unequal", 1602 }, 1603 "myisam_use_mmap": { 1604 Name: "myisam_use_mmap", 1605 Scope: sql.SystemVariableScope_Global, 1606 Dynamic: true, 1607 SetVarHintApplies: false, 1608 Type: types.NewSystemBoolType("myisam_use_mmap"), 1609 Default: int8(0), 1610 }, 1611 "mysql_native_password_proxy_users": { 1612 Name: "mysql_native_password_proxy_users", 1613 Scope: sql.SystemVariableScope_Global, 1614 Dynamic: true, 1615 SetVarHintApplies: false, 1616 Type: types.NewSystemBoolType("mysql_native_password_proxy_users"), 1617 Default: int8(0), 1618 }, 1619 "named_pipe": { 1620 Name: "named_pipe", 1621 Scope: sql.SystemVariableScope_Global, 1622 Dynamic: false, 1623 SetVarHintApplies: false, 1624 Type: types.NewSystemBoolType("named_pipe"), 1625 Default: int8(0), 1626 }, 1627 "named_pipe_full_access_group": { 1628 Name: "named_pipe_full_access_group", 1629 Scope: sql.SystemVariableScope_Global, 1630 Dynamic: false, 1631 SetVarHintApplies: false, 1632 Type: types.NewSystemStringType("named_pipe_full_access_group"), 1633 Default: "", 1634 }, 1635 "ndbinfo_version": { 1636 Name: "ndbinfo_version", 1637 Scope: sql.SystemVariableScope_Global, 1638 Dynamic: false, 1639 SetVarHintApplies: false, 1640 Type: types.NewSystemStringType("ndbinfo_version"), 1641 Default: "", 1642 }, 1643 "net_buffer_length": { 1644 Name: "net_buffer_length", 1645 Scope: sql.SystemVariableScope_Both, 1646 Dynamic: true, 1647 SetVarHintApplies: false, 1648 Type: types.NewSystemIntType("net_buffer_length", 1024, 1048576, false), 1649 Default: int64(16384), 1650 }, 1651 "net_read_timeout": { 1652 Name: "net_read_timeout", 1653 Scope: sql.SystemVariableScope_Both, 1654 Dynamic: true, 1655 SetVarHintApplies: false, 1656 Type: types.NewSystemIntType("net_read_timeout", 1, 9223372036854775807, false), 1657 Default: int64(30), 1658 }, 1659 "net_retry_count": { 1660 Name: "net_retry_count", 1661 Scope: sql.SystemVariableScope_Both, 1662 Dynamic: true, 1663 SetVarHintApplies: false, 1664 Type: types.NewSystemUintType("net_retry_count", 1, 18446744073709551615), 1665 Default: uint64(10), 1666 }, 1667 "net_write_timeout": { 1668 Name: "net_write_timeout", 1669 Scope: sql.SystemVariableScope_Both, 1670 Dynamic: true, 1671 SetVarHintApplies: false, 1672 Type: types.NewSystemIntType("net_write_timeout", 1, 9223372036854775807, false), 1673 Default: int64(60), 1674 }, 1675 "new": { 1676 Name: "new", 1677 Scope: sql.SystemVariableScope_Both, 1678 Dynamic: true, 1679 SetVarHintApplies: false, 1680 Type: types.NewSystemBoolType("new"), 1681 Default: int8(0), 1682 }, 1683 "ngram_token_size": { 1684 Name: "ngram_token_size", 1685 Scope: sql.SystemVariableScope_Global, 1686 Dynamic: false, 1687 SetVarHintApplies: false, 1688 Type: types.NewSystemIntType("ngram_token_size", 1, 10, false), 1689 Default: int64(2), 1690 }, 1691 "offline_mode": { 1692 Name: "offline_mode", 1693 Scope: sql.SystemVariableScope_Global, 1694 Dynamic: true, 1695 SetVarHintApplies: false, 1696 Type: types.NewSystemBoolType("offline_mode"), 1697 Default: int8(0), 1698 }, 1699 "old": { 1700 Name: "old", 1701 Scope: sql.SystemVariableScope_Global, 1702 Dynamic: false, 1703 SetVarHintApplies: false, 1704 Type: types.NewSystemBoolType("old"), 1705 Default: int8(0), 1706 }, 1707 "old_alter_table": { 1708 Name: "old_alter_table", 1709 Scope: sql.SystemVariableScope_Both, 1710 Dynamic: true, 1711 SetVarHintApplies: false, 1712 Type: types.NewSystemBoolType("old_alter_table"), 1713 Default: int8(0), 1714 }, 1715 "open_files_limit": { 1716 Name: "open_files_limit", 1717 Scope: sql.SystemVariableScope_Global, 1718 Dynamic: false, 1719 SetVarHintApplies: false, 1720 Type: types.NewSystemUintType("open_files_limit", 0, 18446744073709551615), 1721 Default: uint64(5000), 1722 }, 1723 "optimizer_prune_level": { 1724 Name: "optimizer_prune_level", 1725 Scope: sql.SystemVariableScope_Both, 1726 Dynamic: true, 1727 SetVarHintApplies: true, 1728 Type: types.NewSystemIntType("optimizer_prune_level", 0, 1, false), 1729 Default: int64(1), 1730 }, 1731 "optimizer_search_depth": { 1732 Name: "optimizer_search_depth", 1733 Scope: sql.SystemVariableScope_Both, 1734 Dynamic: true, 1735 SetVarHintApplies: true, 1736 Type: types.NewSystemIntType("optimizer_search_depth", 0, 62, false), 1737 Default: int64(62), 1738 }, 1739 // TODO: add proper support for this 1740 // "optimizer_switch": { 1741 // Name: "optimizer_switch", 1742 // Scope: SystemVariableScope_Both, 1743 // Dynamic: true, 1744 // SetVarHintApplies: true, 1745 // Type: NewSystemSetType("optimizer_switch"), 1746 // Default: "", 1747 // }, 1748 "optimizer_trace": { 1749 Name: "optimizer_trace", 1750 Scope: sql.SystemVariableScope_Both, 1751 Dynamic: true, 1752 SetVarHintApplies: false, 1753 Type: types.NewSystemStringType("optimizer_trace"), 1754 Default: "", 1755 }, 1756 "optimizer_trace_features": { 1757 Name: "optimizer_trace_features", 1758 Scope: sql.SystemVariableScope_Both, 1759 Dynamic: true, 1760 SetVarHintApplies: false, 1761 Type: types.NewSystemStringType("optimizer_trace_features"), 1762 Default: "", 1763 }, 1764 "optimizer_trace_limit": { 1765 Name: "optimizer_trace_limit", 1766 Scope: sql.SystemVariableScope_Both, 1767 Dynamic: true, 1768 SetVarHintApplies: false, 1769 Type: types.NewSystemIntType("optimizer_trace_limit", -9223372036854775808, 9223372036854775807, false), 1770 Default: int64(1), 1771 }, 1772 "optimizer_trace_max_mem_size": { 1773 Name: "optimizer_trace_max_mem_size", 1774 Scope: sql.SystemVariableScope_Both, 1775 Dynamic: true, 1776 SetVarHintApplies: true, 1777 Type: types.NewSystemIntType("optimizer_trace_max_mem_size", -9223372036854775808, 9223372036854775807, false), 1778 Default: int64(1048576), 1779 }, 1780 "optimizer_trace_offset": { 1781 Name: "optimizer_trace_offset", 1782 Scope: sql.SystemVariableScope_Both, 1783 Dynamic: true, 1784 SetVarHintApplies: false, 1785 Type: types.NewSystemIntType("optimizer_trace_offset", -9223372036854775808, 9223372036854775807, true), 1786 Default: int64(-1), 1787 }, 1788 "original_server_version": { 1789 Name: "original_server_version", 1790 Scope: sql.SystemVariableScope_Session, 1791 Dynamic: true, 1792 SetVarHintApplies: false, 1793 Type: types.NewSystemIntType("original_server_version", -9223372036854775808, 9223372036854775807, false), 1794 Default: int64(80017), 1795 }, 1796 "parser_max_mem_size": { 1797 Name: "parser_max_mem_size", 1798 Scope: sql.SystemVariableScope_Both, 1799 Dynamic: true, 1800 SetVarHintApplies: false, 1801 Type: types.NewSystemUintType("parser_max_mem_size", 10000000, 18446744073709551615), 1802 Default: uint64(18446744073709551615), 1803 }, 1804 "partial_revokes": { 1805 Name: "partial_revokes", 1806 Scope: sql.SystemVariableScope_Global, 1807 Dynamic: true, 1808 SetVarHintApplies: false, 1809 Type: types.NewSystemBoolType("partial_revokes"), 1810 Default: int8(0), 1811 }, 1812 "password_history": { 1813 Name: "password_history", 1814 Scope: sql.SystemVariableScope_Global, 1815 Dynamic: true, 1816 SetVarHintApplies: false, 1817 Type: types.NewSystemIntType("password_history", 0, 4294967295, false), 1818 Default: int64(0), 1819 }, 1820 "password_require_current": { 1821 Name: "password_require_current", 1822 Scope: sql.SystemVariableScope_Global, 1823 Dynamic: true, 1824 SetVarHintApplies: false, 1825 Type: types.NewSystemBoolType("password_require_current"), 1826 Default: int8(0), 1827 }, 1828 "password_reuse_interval": { 1829 Name: "password_reuse_interval", 1830 Scope: sql.SystemVariableScope_Global, 1831 Dynamic: true, 1832 SetVarHintApplies: false, 1833 Type: types.NewSystemIntType("password_reuse_interval", 0, 4294967295, false), 1834 Default: int64(0), 1835 }, 1836 "performance_schema": { 1837 Name: "performance_schema", 1838 Scope: sql.SystemVariableScope_Global, 1839 Dynamic: false, 1840 SetVarHintApplies: false, 1841 Type: types.NewSystemBoolType("performance_schema"), 1842 Default: int8(1), 1843 }, 1844 "persisted_globals_load": { 1845 Name: "persisted_globals_load", 1846 Scope: sql.SystemVariableScope_Global, 1847 Dynamic: false, 1848 SetVarHintApplies: false, 1849 Type: types.NewSystemBoolType("persisted_globals_load"), 1850 Default: int8(1), 1851 }, 1852 "persist_only_admin_x509_subject": { 1853 Name: "persist_only_admin_x509_subject", 1854 Scope: sql.SystemVariableScope_Global, 1855 Dynamic: false, 1856 SetVarHintApplies: false, 1857 Type: types.NewSystemStringType("persist_only_admin_x509_subject"), 1858 Default: "", 1859 }, 1860 "pid_file": { 1861 Name: "pid_file", 1862 Scope: sql.SystemVariableScope_Global, 1863 Dynamic: false, 1864 SetVarHintApplies: false, 1865 Type: types.NewSystemStringType("pid_file"), 1866 Default: "", 1867 }, 1868 "plugin_dir": { 1869 Name: "plugin_dir", 1870 Scope: sql.SystemVariableScope_Global, 1871 Dynamic: false, 1872 SetVarHintApplies: false, 1873 Type: types.NewSystemStringType("plugin_dir"), 1874 Default: "", 1875 }, 1876 "port": { 1877 Name: "port", 1878 Scope: sql.SystemVariableScope_Global, 1879 Dynamic: false, 1880 SetVarHintApplies: false, 1881 Type: types.NewSystemIntType("port", 0, 65535, false), 1882 Default: int64(3306), 1883 }, 1884 "preload_buffer_size": { 1885 Name: "preload_buffer_size", 1886 Scope: sql.SystemVariableScope_Both, 1887 Dynamic: true, 1888 SetVarHintApplies: false, 1889 Type: types.NewSystemIntType("preload_buffer_size", 1024, 1073741824, false), 1890 Default: int64(32768), 1891 }, 1892 "print_identified_with_as_hex": { 1893 Name: "print_identified_with_as_hex", 1894 Scope: sql.SystemVariableScope_Both, 1895 Dynamic: true, 1896 SetVarHintApplies: false, 1897 Type: types.NewSystemBoolType("print_identified_with_as_hex"), 1898 Default: int8(0), 1899 }, 1900 "protocol_compression_algorithms": { 1901 Name: "protocol_compression_algorithms", 1902 Scope: sql.SystemVariableScope_Global, 1903 Dynamic: true, 1904 SetVarHintApplies: false, 1905 Type: types.NewSystemSetType("protocol_compression_algorithms", "zlib", "zstd", "uncompressed"), 1906 Default: "zlib,zstd,uncompressed", 1907 }, 1908 "protocol_version": { 1909 Name: "protocol_version", 1910 Scope: sql.SystemVariableScope_Global, 1911 Dynamic: false, 1912 SetVarHintApplies: false, 1913 Type: types.NewSystemIntType("protocol_version", -9223372036854775808, 9223372036854775807, false), 1914 Default: int64(0), 1915 }, 1916 "proxy_user": { 1917 Name: "proxy_user", 1918 Scope: sql.SystemVariableScope_Session, 1919 Dynamic: false, 1920 SetVarHintApplies: false, 1921 Type: types.NewSystemStringType("proxy_user"), 1922 Default: "", 1923 }, 1924 "pseudo_slave_mode": { 1925 Name: "pseudo_slave_mode", 1926 Scope: sql.SystemVariableScope_Session, 1927 Dynamic: true, 1928 SetVarHintApplies: false, 1929 Type: types.NewSystemBoolType("pseudo_slave_mode"), 1930 Default: int8(0), 1931 }, 1932 "pseudo_thread_id": { 1933 Name: "pseudo_thread_id", 1934 Scope: sql.SystemVariableScope_Session, 1935 Dynamic: true, 1936 SetVarHintApplies: false, 1937 Type: types.NewSystemIntType("pseudo_thread_id", -9223372036854775808, 9223372036854775807, false), 1938 Default: int64(0), 1939 }, 1940 // TODO: implement block sizes 1941 // "query_alloc_block_size": { 1942 // Name: "query_alloc_block_size", 1943 // Scope: SystemVariableScope_Both, 1944 // Dynamic: true, 1945 // SetVarHintApplies: false, 1946 // Type: NewSystemIntType("query_alloc_block_size", 1024, 4294967295, false), 1947 // Default: int64(8192), 1948 // }, 1949 "query_cache_size": { 1950 Name: "query_cache_size", 1951 Scope: sql.SystemVariableScope_Global, 1952 Dynamic: true, 1953 SetVarHintApplies: false, 1954 Type: types.NewSystemUintType("query_cache_size", 0, 18446744073709551615), 1955 Default: int8(1), 1956 }, 1957 "query_cache_type": { 1958 Name: "query_cache_type", 1959 Scope: sql.SystemVariableScope_Both, 1960 Dynamic: true, 1961 SetVarHintApplies: false, 1962 Type: types.NewSystemEnumType("query_cache_type", "OFF", "ON", "DEMAND"), 1963 Default: "OFF", 1964 }, 1965 // "query_prealloc_size": { 1966 // Name: "query_prealloc_size", 1967 // Scope: SystemVariableScope_Both, 1968 // Dynamic: true, 1969 // SetVarHintApplies: false, 1970 // Type: NewSystemUintType("query_prealloc_size", 8192, 18446744073709551615), 1971 // Default: uint64(8192), 1972 // }, 1973 "rand_seed1": { 1974 Name: "rand_seed1", 1975 Scope: sql.SystemVariableScope_Session, 1976 Dynamic: true, 1977 SetVarHintApplies: false, 1978 Type: types.NewSystemIntType("rand_seed1", -9223372036854775808, 9223372036854775807, false), 1979 Default: int64(0), 1980 }, 1981 // TODO: implement block sizes 1982 // "range_alloc_block_size": { 1983 // Name: "range_alloc_block_size", 1984 // Scope: SystemVariableScope_Both, 1985 // Dynamic: true, 1986 // SetVarHintApplies: true, 1987 // Type: NewSystemUintType("range_alloc_block_size", 4096, 18446744073709547520), 1988 // Default: uint64(4096), 1989 // }, 1990 "range_optimizer_max_mem_size": { 1991 Name: "range_optimizer_max_mem_size", 1992 Scope: sql.SystemVariableScope_Both, 1993 Dynamic: true, 1994 SetVarHintApplies: false, 1995 Type: types.NewSystemUintType("range_optimizer_max_mem_size", 0, 18446744073709551615), 1996 Default: uint64(8388608), 1997 }, 1998 "rbr_exec_mode": { 1999 Name: "rbr_exec_mode", 2000 Scope: sql.SystemVariableScope_Both, 2001 Dynamic: true, 2002 SetVarHintApplies: false, 2003 Type: types.NewSystemEnumType("rbr_exec_mode", "IDEMPOTENT", "STRICT"), 2004 Default: "STRICT", 2005 }, 2006 "read_buffer_size": { 2007 Name: "read_buffer_size", 2008 Scope: sql.SystemVariableScope_Both, 2009 Dynamic: true, 2010 SetVarHintApplies: true, 2011 Type: types.NewSystemIntType("read_buffer_size", 8192, 2147479552, false), 2012 Default: int64(131072), 2013 }, 2014 "read_only": { 2015 Name: "read_only", 2016 Scope: sql.SystemVariableScope_Global, 2017 Dynamic: true, 2018 SetVarHintApplies: false, 2019 Type: types.NewSystemBoolType("read_only"), 2020 Default: int8(0), 2021 }, 2022 "read_rnd_buffer_size": { 2023 Name: "read_rnd_buffer_size", 2024 Scope: sql.SystemVariableScope_Both, 2025 Dynamic: true, 2026 SetVarHintApplies: true, 2027 Type: types.NewSystemIntType("read_rnd_buffer_size", 1, 2147483647, false), 2028 Default: int64(262144), 2029 }, 2030 "regexp_buffer_size": { 2031 Name: "regexp_buffer_size", 2032 Scope: sql.SystemVariableScope_Global, 2033 Dynamic: true, 2034 SetVarHintApplies: false, 2035 Type: types.NewSystemUintType("regexp_buffer_size", 0, 67108864), // 64MB upperbound 2036 Default: uint64(524288), 2037 }, 2038 "regexp_stack_limit": { 2039 Name: "regexp_stack_limit", 2040 Scope: sql.SystemVariableScope_Global, 2041 Dynamic: true, 2042 SetVarHintApplies: false, 2043 Type: types.NewSystemIntType("regexp_stack_limit", 0, 2147483647, false), 2044 Default: int64(8000000), 2045 }, 2046 "regexp_time_limit": { 2047 Name: "regexp_time_limit", 2048 Scope: sql.SystemVariableScope_Global, 2049 Dynamic: true, 2050 SetVarHintApplies: false, 2051 Type: types.NewSystemIntType("regexp_time_limit", 0, 2147483647, false), 2052 Default: int64(32), 2053 }, 2054 "require_row_format": { 2055 Name: "require_row_format", 2056 Scope: sql.SystemVariableScope_Session, 2057 Dynamic: true, 2058 SetVarHintApplies: false, 2059 Type: types.NewSystemBoolType("require_row_format"), 2060 Default: int8(0), 2061 }, 2062 "require_secure_transport": { 2063 Name: "require_secure_transport", 2064 Scope: sql.SystemVariableScope_Global, 2065 Dynamic: true, 2066 SetVarHintApplies: false, 2067 Type: types.NewSystemBoolType("require_secure_transport"), 2068 Default: int8(0), 2069 }, 2070 "resultset_metadata": { 2071 Name: "resultset_metadata", 2072 Scope: sql.SystemVariableScope_Session, 2073 Dynamic: true, 2074 SetVarHintApplies: false, 2075 Type: types.NewSystemEnumType("resultset_metadata", "FULL", "NONE"), 2076 Default: "FULL", 2077 }, 2078 "secondary_engine_cost_threshold": { 2079 Name: "secondary_engine_cost_threshold", 2080 Scope: sql.SystemVariableScope_Session, 2081 Dynamic: true, 2082 SetVarHintApplies: true, 2083 Type: types.NewSystemDoubleType("secondary_engine_cost_threshold", 0, math.MaxFloat64), 2084 Default: float64(100000.000000), 2085 }, 2086 "schema_definition_cache": { 2087 Name: "schema_definition_cache", 2088 Scope: sql.SystemVariableScope_Global, 2089 Dynamic: true, 2090 SetVarHintApplies: false, 2091 Type: types.NewSystemIntType("schema_definition_cache", 256, 524288, false), 2092 Default: int64(256), 2093 }, 2094 "secure_file_priv": { 2095 Name: "secure_file_priv", 2096 Scope: sql.SystemVariableScope_Global, 2097 Dynamic: false, 2098 SetVarHintApplies: false, 2099 Type: types.NewSystemStringType("secure_file_priv"), 2100 Default: "", 2101 }, 2102 "select_into_buffer_size": { 2103 Name: "select_into_buffer_size", 2104 Scope: sql.SystemVariableScope_Both, 2105 Dynamic: true, 2106 SetVarHintApplies: true, 2107 Type: types.NewSystemIntType("select_into_buffer_size", 8192, 2147479552, false), 2108 Default: int64(131072), 2109 }, 2110 "select_into_disk_sync": { 2111 Name: "select_into_disk_sync", 2112 Scope: sql.SystemVariableScope_Both, 2113 Dynamic: true, 2114 SetVarHintApplies: true, 2115 Type: types.NewSystemBoolType("select_into_disk_sync"), 2116 Default: int8(0), 2117 }, 2118 "select_into_disk_sync_delay": { 2119 Name: "select_into_disk_sync_delay", 2120 Scope: sql.SystemVariableScope_Both, 2121 Dynamic: true, 2122 SetVarHintApplies: true, 2123 Type: types.NewSystemIntType("select_into_disk_sync_delay", 0, 31536000, false), 2124 Default: int64(0), 2125 }, 2126 "server_id": { 2127 Name: "server_id", 2128 Scope: sql.SystemVariableScope_Persist, 2129 Dynamic: true, 2130 SetVarHintApplies: false, 2131 Type: types.Uint32, 2132 Default: uint32(0), 2133 }, 2134 "server_uuid": { 2135 Name: "server_uuid", 2136 Scope: sql.SystemVariableScope_Persist, 2137 Dynamic: false, 2138 SetVarHintApplies: false, 2139 Type: types.Text, 2140 Default: uuid.New().String(), 2141 }, 2142 "session_track_gtids": { 2143 Name: "session_track_gtids", 2144 Scope: sql.SystemVariableScope_Both, 2145 Dynamic: true, 2146 SetVarHintApplies: false, 2147 Type: types.NewSystemEnumType("session_track_gtids", "OFF", "OWN_GTID", "ALL_GTIDS"), 2148 Default: "OFF", 2149 }, 2150 "session_track_schema": { 2151 Name: "session_track_schema", 2152 Scope: sql.SystemVariableScope_Both, 2153 Dynamic: true, 2154 SetVarHintApplies: false, 2155 Type: types.NewSystemBoolType("session_track_schema"), 2156 Default: int8(1), 2157 }, 2158 "session_track_state_change": { 2159 Name: "session_track_state_change", 2160 Scope: sql.SystemVariableScope_Both, 2161 Dynamic: true, 2162 SetVarHintApplies: false, 2163 Type: types.NewSystemBoolType("session_track_state_change"), 2164 Default: int8(0), 2165 }, 2166 "session_track_system_variables": { 2167 Name: "session_track_system_variables", 2168 Scope: sql.SystemVariableScope_Both, 2169 Dynamic: true, 2170 SetVarHintApplies: false, 2171 Type: types.NewSystemStringType("session_track_system_variables"), 2172 Default: "time_zone, autocommit, character_set_client, character_set_results, character_set_connection", 2173 }, 2174 "session_track_transaction_info": { 2175 Name: "session_track_transaction_info", 2176 Scope: sql.SystemVariableScope_Both, 2177 Dynamic: true, 2178 SetVarHintApplies: false, 2179 Type: types.NewSystemEnumType("session_track_transaction_info", "OFF", "STATE", "CHARACTERISTICS"), 2180 Default: "OFF", 2181 }, 2182 "sha256_password_auto_generate_rsa_keys": { 2183 Name: "sha256_password_auto_generate_rsa_keys", 2184 Scope: sql.SystemVariableScope_Global, 2185 Dynamic: false, 2186 SetVarHintApplies: false, 2187 Type: types.NewSystemBoolType("sha256_password_auto_generate_rsa_keys"), 2188 Default: int8(1), 2189 }, 2190 "sha256_password_private_key_path": { 2191 Name: "sha256_password_private_key_path", 2192 Scope: sql.SystemVariableScope_Global, 2193 Dynamic: false, 2194 SetVarHintApplies: false, 2195 Type: types.NewSystemStringType("sha256_password_private_key_path"), 2196 Default: "private_key.pem", 2197 }, 2198 "sha256_password_proxy_users": { 2199 Name: "sha256_password_proxy_users", 2200 Scope: sql.SystemVariableScope_Global, 2201 Dynamic: true, 2202 SetVarHintApplies: false, 2203 Type: types.NewSystemBoolType("sha256_password_proxy_users"), 2204 Default: int8(0), 2205 }, 2206 "sha256_password_public_key_path": { 2207 Name: "sha256_password_public_key_path", 2208 Scope: sql.SystemVariableScope_Global, 2209 Dynamic: false, 2210 SetVarHintApplies: false, 2211 Type: types.NewSystemStringType("sha256_password_public_key_path"), 2212 Default: "public_key.pem", 2213 }, 2214 "shared_memory": { 2215 Name: "shared_memory", 2216 Scope: sql.SystemVariableScope_Global, 2217 Dynamic: false, 2218 SetVarHintApplies: false, 2219 Type: types.NewSystemBoolType("shared_memory"), 2220 Default: int8(0), 2221 }, 2222 "shared_memory_base_name": { 2223 Name: "shared_memory_base_name", 2224 Scope: sql.SystemVariableScope_Global, 2225 Dynamic: false, 2226 SetVarHintApplies: false, 2227 Type: types.NewSystemStringType("shared_memory_base_name"), 2228 Default: "MYSQL", 2229 }, 2230 "show_create_table_skip_secondary_engine": { 2231 Name: "show_create_table_skip_secondary_engine", 2232 Scope: sql.SystemVariableScope_Session, 2233 Dynamic: true, 2234 SetVarHintApplies: true, 2235 Type: types.NewSystemBoolType("show_create_table_skip_secondary_engine"), 2236 Default: int8(0), 2237 }, 2238 "show_create_table_verbosity": { 2239 Name: "show_create_table_verbosity", 2240 Scope: sql.SystemVariableScope_Both, 2241 Dynamic: true, 2242 SetVarHintApplies: false, 2243 Type: types.NewSystemBoolType("show_create_table_verbosity"), 2244 Default: int8(0), 2245 }, 2246 "show_external_procedures": { 2247 Name: "show_external_procedures", 2248 Scope: sql.SystemVariableScope_Both, 2249 Dynamic: true, 2250 SetVarHintApplies: true, 2251 Type: types.NewSystemBoolType("show_external_procedures"), 2252 Default: int8(1), 2253 }, 2254 "show_old_temporals": { 2255 Name: "show_old_temporals", 2256 Scope: sql.SystemVariableScope_Both, 2257 Dynamic: true, 2258 SetVarHintApplies: false, 2259 Type: types.NewSystemBoolType("show_old_temporals"), 2260 Default: int8(0), 2261 }, 2262 "skip_external_locking": { 2263 Name: "skip_external_locking", 2264 Scope: sql.SystemVariableScope_Global, 2265 Dynamic: false, 2266 SetVarHintApplies: false, 2267 Type: types.NewSystemBoolType("skip_external_locking"), 2268 Default: int8(1), 2269 }, 2270 "skip_name_resolve": { 2271 Name: "skip_name_resolve", 2272 Scope: sql.SystemVariableScope_Global, 2273 Dynamic: false, 2274 SetVarHintApplies: false, 2275 Type: types.NewSystemBoolType("skip_name_resolve"), 2276 Default: int8(0), 2277 }, 2278 "skip_networking": { 2279 Name: "skip_networking", 2280 Scope: sql.SystemVariableScope_Global, 2281 Dynamic: false, 2282 SetVarHintApplies: false, 2283 Type: types.NewSystemBoolType("skip_networking"), 2284 Default: int8(0), 2285 }, 2286 "skip_show_database": { 2287 Name: "skip_show_database", 2288 Scope: sql.SystemVariableScope_Global, 2289 Dynamic: false, 2290 SetVarHintApplies: false, 2291 Type: types.NewSystemBoolType("skip_show_database"), 2292 Default: int8(0), 2293 }, 2294 "slow_launch_time": { 2295 Name: "slow_launch_time", 2296 Scope: sql.SystemVariableScope_Global, 2297 Dynamic: true, 2298 SetVarHintApplies: false, 2299 Type: types.NewSystemIntType("slow_launch_time", -9223372036854775808, 9223372036854775807, false), 2300 Default: int64(2), 2301 }, 2302 "slow_query_log": { 2303 Name: "slow_query_log", 2304 Scope: sql.SystemVariableScope_Global, 2305 Dynamic: true, 2306 SetVarHintApplies: false, 2307 Type: types.NewSystemBoolType("slow_query_log"), 2308 Default: int8(0), 2309 }, 2310 "slow_query_log_file": { 2311 Name: "slow_query_log_file", 2312 Scope: sql.SystemVariableScope_Global, 2313 Dynamic: true, 2314 SetVarHintApplies: false, 2315 Type: types.NewSystemStringType("slow_query_log_file"), 2316 Default: "host_name-slow.log", 2317 }, 2318 "socket": { 2319 Name: "socket", 2320 Scope: sql.SystemVariableScope_Global, 2321 Dynamic: false, 2322 SetVarHintApplies: false, 2323 Type: types.NewSystemStringType("socket"), 2324 Default: "/tmp/mysql.sock", 2325 }, 2326 "sort_buffer_size": { 2327 Name: "sort_buffer_size", 2328 Scope: sql.SystemVariableScope_Both, 2329 Dynamic: true, 2330 SetVarHintApplies: true, 2331 Type: types.NewSystemUintType("sort_buffer_size", 32768, 18446744073709551615), 2332 Default: uint64(262144), 2333 }, 2334 "sql_auto_is_null": { 2335 Name: "sql_auto_is_null", 2336 Scope: sql.SystemVariableScope_Both, 2337 Dynamic: true, 2338 SetVarHintApplies: true, 2339 Type: types.NewSystemBoolType("sql_auto_is_null"), 2340 Default: int8(0), 2341 }, 2342 "sql_big_selects": { 2343 Name: "sql_big_selects", 2344 Scope: sql.SystemVariableScope_Both, 2345 Dynamic: true, 2346 SetVarHintApplies: true, 2347 Type: types.NewSystemBoolType("sql_big_selects"), 2348 Default: int8(1), 2349 }, 2350 "sql_buffer_result": { 2351 Name: "sql_buffer_result", 2352 Scope: sql.SystemVariableScope_Both, 2353 Dynamic: true, 2354 SetVarHintApplies: true, 2355 Type: types.NewSystemBoolType("sql_buffer_result"), 2356 Default: int8(0), 2357 }, 2358 "sql_log_bin": { 2359 Name: "sql_log_bin", 2360 Scope: sql.SystemVariableScope_Both, 2361 Dynamic: true, 2362 SetVarHintApplies: false, 2363 Type: types.NewSystemBoolType("sql_log_bin"), 2364 Default: int8(0), 2365 }, 2366 "sql_log_off": { 2367 Name: "sql_log_off", 2368 Scope: sql.SystemVariableScope_Both, 2369 Dynamic: true, 2370 SetVarHintApplies: false, 2371 Type: types.NewSystemBoolType("sql_log_off"), 2372 Default: int8(0), 2373 }, 2374 "sql_mode": { 2375 Name: "sql_mode", 2376 Scope: sql.SystemVariableScope_Both, 2377 Dynamic: true, 2378 SetVarHintApplies: true, 2379 Type: types.NewSystemSetType("sql_mode", "ALLOW_INVALID_DATES", "ANSI_QUOTES", "ERROR_FOR_DIVISION_BY_ZERO", "HIGH_NOT_PRECEDENCE", "IGNORE_SPACE", "NO_AUTO_VALUE_ON_ZERO", "NO_BACKSLASH_ESCAPES", "NO_DIR_IN_CREATE", "NO_ENGINE_SUBSTITUTION", "NO_UNSIGNED_SUBTRACTION", "NO_ZERO_DATE", "NO_ZERO_IN_DATE", "ONLY_FULL_GROUP_BY", "PAD_CHAR_TO_FULL_LENGTH", "PIPES_AS_CONCAT", "REAL_AS_FLOAT", "STRICT_ALL_TABLES", "STRICT_TRANS_TABLES", "TIME_TRUNCATE_FRACTIONAL", "TRADITIONAL", "ANSI"), 2380 Default: "NO_ENGINE_SUBSTITUTION,ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES", 2381 }, 2382 "sql_notes": { 2383 Name: "sql_notes", 2384 Scope: sql.SystemVariableScope_Both, 2385 Dynamic: true, 2386 SetVarHintApplies: false, 2387 Type: types.NewSystemBoolType("sql_notes"), 2388 Default: int8(1), 2389 }, 2390 "sql_quote_show_create": { 2391 Name: "sql_quote_show_create", 2392 Scope: sql.SystemVariableScope_Both, 2393 Dynamic: true, 2394 SetVarHintApplies: false, 2395 Type: types.NewSystemBoolType("sql_quote_show_create"), 2396 Default: int8(1), 2397 }, 2398 "sql_require_primary_key": { 2399 Name: "sql_require_primary_key", 2400 Scope: sql.SystemVariableScope_Both, 2401 Dynamic: true, 2402 SetVarHintApplies: true, 2403 Type: types.NewSystemBoolType("sql_require_primary_key"), 2404 Default: int8(0), 2405 }, 2406 "sql_safe_updates": { 2407 Name: "sql_safe_updates", 2408 Scope: sql.SystemVariableScope_Both, 2409 Dynamic: true, 2410 SetVarHintApplies: true, 2411 Type: types.NewSystemBoolType("sql_safe_updates"), 2412 Default: int8(0), 2413 }, 2414 "sql_select_limit": { 2415 Name: "sql_select_limit", 2416 Scope: sql.SystemVariableScope_Both, 2417 Dynamic: true, 2418 SetVarHintApplies: true, 2419 Type: types.NewSystemIntType("sql_select_limit", -9223372036854775808, 9223372036854775807, false), 2420 Default: int64(2147483647), 2421 }, 2422 "sql_warnings": { 2423 Name: "sql_warnings", 2424 Scope: sql.SystemVariableScope_Both, 2425 Dynamic: true, 2426 SetVarHintApplies: false, 2427 Type: types.NewSystemBoolType("sql_warnings"), 2428 Default: int8(0), 2429 }, 2430 "ssl_ca": { 2431 Name: "ssl_ca", 2432 Scope: sql.SystemVariableScope_Global, 2433 Dynamic: true, 2434 SetVarHintApplies: false, 2435 Type: types.NewSystemStringType("ssl_ca"), 2436 Default: "", 2437 }, 2438 "ssl_capath": { 2439 Name: "ssl_capath", 2440 Scope: sql.SystemVariableScope_Global, 2441 Dynamic: true, 2442 SetVarHintApplies: false, 2443 Type: types.NewSystemStringType("ssl_capath"), 2444 Default: "", 2445 }, 2446 "ssl_cert": { 2447 Name: "ssl_cert", 2448 Scope: sql.SystemVariableScope_Global, 2449 Dynamic: true, 2450 SetVarHintApplies: false, 2451 Type: types.NewSystemStringType("ssl_cert"), 2452 Default: "", 2453 }, 2454 "ssl_cipher": { 2455 Name: "ssl_cipher", 2456 Scope: sql.SystemVariableScope_Global, 2457 Dynamic: true, 2458 SetVarHintApplies: false, 2459 Type: types.NewSystemStringType("ssl_cipher"), 2460 Default: "", 2461 }, 2462 "ssl_crl": { 2463 Name: "ssl_crl", 2464 Scope: sql.SystemVariableScope_Global, 2465 Dynamic: true, 2466 SetVarHintApplies: false, 2467 Type: types.NewSystemStringType("ssl_crl"), 2468 Default: "", 2469 }, 2470 "ssl_crlpath": { 2471 Name: "ssl_crlpath", 2472 Scope: sql.SystemVariableScope_Global, 2473 Dynamic: false, 2474 SetVarHintApplies: false, 2475 Type: types.NewSystemStringType("ssl_crlpath"), 2476 Default: "", 2477 }, 2478 "ssl_fips_mode": { 2479 Name: "ssl_fips_mode", 2480 Scope: sql.SystemVariableScope_Global, 2481 Dynamic: true, 2482 SetVarHintApplies: false, 2483 Type: types.NewSystemEnumType("ssl_fips_mode", "OFF", "ON", "STRICT"), 2484 Default: "OFF", 2485 }, 2486 "ssl_key": { 2487 Name: "ssl_key", 2488 Scope: sql.SystemVariableScope_Global, 2489 Dynamic: true, 2490 SetVarHintApplies: false, 2491 Type: types.NewSystemStringType("ssl_key"), 2492 Default: "", 2493 }, 2494 "stored_program_cache": { 2495 Name: "stored_program_cache", 2496 Scope: sql.SystemVariableScope_Global, 2497 Dynamic: true, 2498 SetVarHintApplies: false, 2499 Type: types.NewSystemIntType("stored_program_cache", 16, 524288, false), 2500 Default: int64(256), 2501 }, 2502 "stored_program_definition_cache": { 2503 Name: "stored_program_definition_cache", 2504 Scope: sql.SystemVariableScope_Global, 2505 Dynamic: true, 2506 SetVarHintApplies: false, 2507 Type: types.NewSystemIntType("stored_program_definition_cache", 256, 524288, false), 2508 Default: int64(256), 2509 }, 2510 "strict_mysql_compatibility": { 2511 Name: "strict_mysql_compatibility", 2512 Scope: sql.SystemVariableScope_Both, 2513 Dynamic: true, 2514 SetVarHintApplies: false, 2515 Type: types.NewSystemBoolType("strict_mysql_compatibility"), 2516 Default: int8(0), 2517 }, 2518 "super_read_only": { 2519 Name: "super_read_only", 2520 Scope: sql.SystemVariableScope_Global, 2521 Dynamic: true, 2522 SetVarHintApplies: false, 2523 Type: types.NewSystemBoolType("super_read_only"), 2524 Default: int8(0), 2525 }, 2526 "syseventlog.facility": { 2527 Name: "syseventlog.facility", 2528 Scope: sql.SystemVariableScope_Global, 2529 Dynamic: true, 2530 SetVarHintApplies: false, 2531 Type: types.NewSystemStringType("syseventlog.facility"), 2532 Default: "daemon", 2533 }, 2534 "syseventlog.include_pid": { 2535 Name: "syseventlog.include_pid", 2536 Scope: sql.SystemVariableScope_Global, 2537 Dynamic: true, 2538 SetVarHintApplies: false, 2539 Type: types.NewSystemBoolType("syseventlog.include_pid"), 2540 Default: int8(1), 2541 }, 2542 "syseventlog.tag": { 2543 Name: "syseventlog.tag", 2544 Scope: sql.SystemVariableScope_Global, 2545 Dynamic: true, 2546 SetVarHintApplies: false, 2547 Type: types.NewSystemStringType("syseventlog.tag"), 2548 Default: "", 2549 }, 2550 "system_time_zone": { 2551 Name: "system_time_zone", 2552 Scope: sql.SystemVariableScope_Global, 2553 Dynamic: false, 2554 SetVarHintApplies: false, 2555 Type: types.NewSystemStringType("system_time_zone"), 2556 Default: gmstime.SystemTimezoneName(), 2557 }, 2558 "table_definition_cache": { 2559 Name: "table_definition_cache", 2560 Scope: sql.SystemVariableScope_Global, 2561 Dynamic: true, 2562 SetVarHintApplies: false, 2563 Type: types.NewSystemIntType("table_definition_cache", 400, 524288, true), 2564 Default: int64(-1), 2565 }, 2566 "table_encryption_privilege_check": { 2567 Name: "table_encryption_privilege_check", 2568 Scope: sql.SystemVariableScope_Global, 2569 Dynamic: true, 2570 SetVarHintApplies: false, 2571 Type: types.NewSystemBoolType("table_encryption_privilege_check"), 2572 Default: int8(0), 2573 }, 2574 "table_open_cache": { 2575 Name: "table_open_cache", 2576 Scope: sql.SystemVariableScope_Global, 2577 Dynamic: true, 2578 SetVarHintApplies: false, 2579 Type: types.NewSystemIntType("table_open_cache", 1, 524288, false), 2580 Default: int64(4000), 2581 }, 2582 "table_open_cache_instances": { 2583 Name: "table_open_cache_instances", 2584 Scope: sql.SystemVariableScope_Global, 2585 Dynamic: false, 2586 SetVarHintApplies: false, 2587 Type: types.NewSystemIntType("table_open_cache_instances", 1, 64, false), 2588 Default: int64(16), 2589 }, 2590 "tablespace_definition_cache": { 2591 Name: "tablespace_definition_cache", 2592 Scope: sql.SystemVariableScope_Global, 2593 Dynamic: true, 2594 SetVarHintApplies: false, 2595 Type: types.NewSystemIntType("tablespace_definition_cache", 256, 524288, false), 2596 Default: int64(256), 2597 }, 2598 "temptable_max_mmap": { 2599 Name: "temptable_max_mmap", 2600 Scope: sql.SystemVariableScope_Global, 2601 Dynamic: true, 2602 SetVarHintApplies: false, 2603 Type: types.NewSystemUintType("temptable_max_mmap", 0, 18446744073709551615), 2604 Default: uint64(1073741824), 2605 }, 2606 "temptable_max_ram": { 2607 Name: "temptable_max_ram", 2608 Scope: sql.SystemVariableScope_Global, 2609 Dynamic: true, 2610 SetVarHintApplies: false, 2611 Type: types.NewSystemUintType("temptable_max_ram", 2097152, 18446744073709551615), 2612 Default: uint64(1073741824), 2613 }, 2614 "temptable_use_mmap": { 2615 Name: "temptable_use_mmap", 2616 Scope: sql.SystemVariableScope_Global, 2617 Dynamic: true, 2618 SetVarHintApplies: false, 2619 Type: types.NewSystemBoolType("temptable_use_mmap"), 2620 Default: int8(1), 2621 }, 2622 "thread_cache_size": { 2623 Name: "thread_cache_size", 2624 Scope: sql.SystemVariableScope_Global, 2625 Dynamic: true, 2626 SetVarHintApplies: false, 2627 Type: types.NewSystemIntType("thread_cache_size", 0, 16384, true), 2628 Default: int64(-1), 2629 }, 2630 "thread_handling": { 2631 Name: "thread_handling", 2632 Scope: sql.SystemVariableScope_Global, 2633 Dynamic: false, 2634 SetVarHintApplies: false, 2635 Type: types.NewSystemEnumType("thread_handling", "no-threads", "one-thread-per-connection", "loaded-dynamically"), 2636 Default: "one-thread-per-connection", 2637 }, 2638 "thread_pool_algorithm": { 2639 Name: "thread_pool_algorithm", 2640 Scope: sql.SystemVariableScope_Global, 2641 Dynamic: false, 2642 SetVarHintApplies: false, 2643 Type: types.NewSystemIntType("thread_pool_algorithm", 0, 1, false), 2644 Default: int64(0), 2645 }, 2646 "thread_pool_high_priority_connection": { 2647 Name: "thread_pool_high_priority_connection", 2648 Scope: sql.SystemVariableScope_Both, 2649 Dynamic: true, 2650 SetVarHintApplies: false, 2651 Type: types.NewSystemIntType("thread_pool_high_priority_connection", 0, 1, false), 2652 Default: int64(0), 2653 }, 2654 "thread_pool_max_active_query_threads": { 2655 Name: "thread_pool_max_active_query_threads", 2656 Scope: sql.SystemVariableScope_Global, 2657 Dynamic: true, 2658 SetVarHintApplies: false, 2659 Type: types.NewSystemIntType("thread_pool_max_active_query_threads", 0, 512, false), 2660 Default: int64(0), 2661 }, 2662 "thread_pool_max_unused_threads": { 2663 Name: "thread_pool_max_unused_threads", 2664 Scope: sql.SystemVariableScope_Global, 2665 Dynamic: true, 2666 SetVarHintApplies: false, 2667 Type: types.NewSystemIntType("thread_pool_max_unused_threads", 0, 4096, false), 2668 Default: int64(0), 2669 }, 2670 "thread_pool_prio_kickup_timer": { 2671 Name: "thread_pool_prio_kickup_timer", 2672 Scope: sql.SystemVariableScope_Global, 2673 Dynamic: true, 2674 SetVarHintApplies: false, 2675 Type: types.NewSystemIntType("thread_pool_prio_kickup_timer", 0, 4294967294, false), 2676 Default: int64(1000), 2677 }, 2678 "thread_pool_size": { 2679 Name: "thread_pool_size", 2680 Scope: sql.SystemVariableScope_Global, 2681 Dynamic: false, 2682 SetVarHintApplies: false, 2683 Type: types.NewSystemIntType("thread_pool_size", 1, 512, false), 2684 Default: int64(16), 2685 }, 2686 "thread_pool_stall_limit": { 2687 Name: "thread_pool_stall_limit", 2688 Scope: sql.SystemVariableScope_Global, 2689 Dynamic: true, 2690 SetVarHintApplies: false, 2691 Type: types.NewSystemIntType("thread_pool_stall_limit", 4, 600, false), 2692 Default: int64(6), 2693 }, 2694 // TODO: implement block sizes 2695 // "thread_stack": { 2696 // Name: "thread_stack", 2697 // Scope: SystemVariableScope_Global, 2698 // Dynamic: false, 2699 // SetVarHintApplies: false, 2700 // Type: NewSystemUintType("thread_stack", 131072, 18446744073709551615), 2701 // Default: uint64(286720), 2702 // }, 2703 "time_zone": { 2704 Name: "time_zone", 2705 Scope: sql.SystemVariableScope_Both, 2706 Dynamic: true, 2707 SetVarHintApplies: true, 2708 Type: types.NewSystemStringType("time_zone"), 2709 Default: "SYSTEM", 2710 }, 2711 // TODO: this needs to utilize a function as the value is not static 2712 "timestamp": { 2713 Name: "timestamp", 2714 Scope: sql.SystemVariableScope_Session, 2715 Dynamic: true, 2716 SetVarHintApplies: true, 2717 Type: types.NewSystemDoubleType("timestamp", 1, 2147483647), 2718 Default: float64(1000.0), 2719 }, 2720 "tls_ciphersuites": { 2721 Name: "tls_ciphersuites", 2722 Scope: sql.SystemVariableScope_Global, 2723 Dynamic: true, 2724 SetVarHintApplies: false, 2725 Type: types.NewSystemStringType("tls_ciphersuites"), 2726 Default: "", 2727 }, 2728 "tls_version": { 2729 Name: "tls_version", 2730 Scope: sql.SystemVariableScope_Global, 2731 Dynamic: true, 2732 SetVarHintApplies: false, 2733 Type: types.NewSystemStringType("tls_version"), 2734 Default: "TLSv1,TLSv1.1,TLSv1.2,TLSv1.3", 2735 }, 2736 "tmp_table_size": { 2737 Name: "tmp_table_size", 2738 Scope: sql.SystemVariableScope_Both, 2739 Dynamic: true, 2740 SetVarHintApplies: true, 2741 Type: types.NewSystemUintType("tmp_table_size", 1024, 18446744073709551615), 2742 Default: uint64(16777216), 2743 }, 2744 "tmpdir": { 2745 Name: "tmpdir", 2746 Scope: sql.SystemVariableScope_Global, 2747 Dynamic: false, 2748 SetVarHintApplies: false, 2749 Type: types.NewSystemStringType("tmpdir"), 2750 Default: sql.GetTmpdirSessionVar(), 2751 }, 2752 // TODO: implement block sizes 2753 // "transaction_alloc_block_size": { 2754 // Name: "transaction_alloc_block_size", 2755 // Scope: SystemVariableScope_Both, 2756 // Dynamic: true, 2757 // SetVarHintApplies: false, 2758 // Type: NewSystemIntType("transaction_alloc_block_size", 1024, 131072, false), 2759 // Default: int64(8192), 2760 // }, 2761 "transaction_isolation": { 2762 Name: "transaction_isolation", 2763 Scope: sql.SystemVariableScope_Both, 2764 Dynamic: true, 2765 SetVarHintApplies: false, 2766 Type: types.NewSystemEnumType("transaction_isolation", "READ-UNCOMMITTED", "READ-COMMITTED", "REPEATABLE-READ", "SERIALIZABLE"), 2767 Default: "REPEATABLE-READ", 2768 }, 2769 "transaction_prealloc_size": { 2770 Name: "transaction_prealloc_size", 2771 Scope: sql.SystemVariableScope_Both, 2772 Dynamic: true, 2773 SetVarHintApplies: false, 2774 Type: types.NewSystemIntType("transaction_prealloc_size", 1024, 131072, false), 2775 Default: int64(4096), 2776 }, 2777 "transaction_read_only": { 2778 Name: "transaction_read_only", 2779 Scope: sql.SystemVariableScope_Both, 2780 Dynamic: true, 2781 SetVarHintApplies: false, 2782 Type: types.NewSystemBoolType("transaction_read_only"), 2783 Default: int8(0), 2784 }, 2785 "tx_isolation": { 2786 Name: "tx_isolation", 2787 Scope: sql.SystemVariableScope_Both, 2788 Dynamic: true, 2789 SetVarHintApplies: false, 2790 Type: types.NewSystemEnumType("tx_isolation", "READ-UNCOMMITTED", "READ-COMMITTED", "REPEATABLE-READ", "SERIALIZABLE"), 2791 Default: "REPEATABLE-READ", 2792 }, 2793 "tx_read_only": { 2794 Name: "tx_read_only", 2795 Scope: sql.SystemVariableScope_Both, 2796 Dynamic: true, 2797 SetVarHintApplies: false, 2798 Type: types.NewSystemBoolType("tx_read_only"), 2799 Default: int8(0), 2800 }, 2801 "unique_checks": { 2802 Name: "unique_checks", 2803 Scope: sql.SystemVariableScope_Both, 2804 Dynamic: true, 2805 SetVarHintApplies: true, 2806 Type: types.NewSystemBoolType("unique_checks"), 2807 Default: int8(1), 2808 }, 2809 "updatable_views_with_limit": { 2810 Name: "updatable_views_with_limit", 2811 Scope: sql.SystemVariableScope_Both, 2812 Dynamic: true, 2813 SetVarHintApplies: true, 2814 Type: types.NewSystemBoolType("updatable_views_with_limit"), 2815 Default: int8(1), 2816 }, 2817 "uptime": { 2818 Name: "uptime", 2819 Scope: sql.SystemVariableScope_Both, 2820 Dynamic: true, 2821 SetVarHintApplies: true, 2822 Type: types.NewSystemBoolType("updatable_views_with_limit"), 2823 Default: int8(1), 2824 ValueFunction: func() (interface{}, error) { 2825 return int(time.Now().Sub(serverStartUpTime).Seconds()), nil 2826 }, 2827 }, 2828 "use_secondary_engine": { 2829 Name: "use_secondary_engine", 2830 Scope: sql.SystemVariableScope_Session, 2831 Dynamic: true, 2832 SetVarHintApplies: true, 2833 Type: types.NewSystemEnumType("use_secondary_engine", "OFF", "ON", "FORCED"), 2834 Default: "ON", 2835 }, 2836 "validate_user_plugins": { 2837 Name: "validate_user_plugins", 2838 Scope: sql.SystemVariableScope_Global, 2839 Dynamic: false, 2840 SetVarHintApplies: false, 2841 Type: types.NewSystemBoolType("validate_user_plugins"), 2842 Default: int8(1), 2843 }, 2844 "version": { 2845 Name: "version", 2846 Scope: sql.SystemVariableScope_Global, 2847 Dynamic: false, 2848 SetVarHintApplies: false, 2849 Type: types.NewSystemStringType("version"), 2850 Default: "8.0.11", 2851 }, 2852 "version_comment": { 2853 Name: "version_comment", 2854 Scope: sql.SystemVariableScope_Global, 2855 Dynamic: false, 2856 SetVarHintApplies: false, 2857 Type: types.NewSystemStringType("version_comment"), 2858 Default: "Dolt", 2859 }, 2860 "version_compile_machine": { 2861 Name: "version_compile_machine", 2862 Scope: sql.SystemVariableScope_Global, 2863 Dynamic: false, 2864 SetVarHintApplies: false, 2865 Type: types.NewSystemStringType("version_compile_machine"), 2866 Default: "", 2867 }, 2868 "version_compile_os": { 2869 Name: "version_compile_os", 2870 Scope: sql.SystemVariableScope_Global, 2871 Dynamic: false, 2872 SetVarHintApplies: false, 2873 Type: types.NewSystemStringType("version_compile_os"), 2874 Default: "", 2875 }, 2876 "version_compile_zlib": { 2877 Name: "version_compile_zlib", 2878 Scope: sql.SystemVariableScope_Global, 2879 Dynamic: false, 2880 SetVarHintApplies: false, 2881 Type: types.NewSystemStringType("version_compile_zlib"), 2882 Default: "", 2883 }, 2884 "wait_timeout": { 2885 Name: "wait_timeout", 2886 Scope: sql.SystemVariableScope_Both, 2887 Dynamic: true, 2888 SetVarHintApplies: false, 2889 Type: types.NewSystemIntType("wait_timeout", 1, 31536000, false), 2890 Default: int64(28800), 2891 }, 2892 "windowing_use_high_precision": { 2893 Name: "windowing_use_high_precision", 2894 Scope: sql.SystemVariableScope_Both, 2895 Dynamic: true, 2896 SetVarHintApplies: true, 2897 Type: types.NewSystemBoolType("windowing_use_high_precision"), 2898 Default: int8(1), 2899 }, 2900 }