Skip to content

Commit

Permalink
sessionctx: cleanup old InnoDB sysvars (#58357)
Browse files Browse the repository at this point in the history
close #9142
  • Loading branch information
dveeden authored Dec 27, 2024
1 parent 293077b commit df44404
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 17 deletions.
13 changes: 0 additions & 13 deletions pkg/sessionctx/variable/noop.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ var noopSysVars = []*SysVar{
},
{Scope: ScopeNone, Name: "have_rtree_keys", Value: "YES"},
{Scope: ScopeGlobal, Name: "innodb_old_blocks_pct", Value: "37"},
{Scope: ScopeGlobal, Name: "innodb_file_format", Value: "Barracuda", Type: TypeEnum, PossibleValues: []string{"Antelope", "Barracuda"}},
{Scope: ScopeGlobal, Name: "innodb_default_row_format", Value: "dynamic", Type: TypeEnum, PossibleValues: []string{"redundant", "compact", "dynamic"}},
{Scope: ScopeGlobal, Name: "innodb_compression_failure_threshold_pct", Value: "5"},
{Scope: ScopeNone, Name: "performance_schema_events_waits_history_long_size", Value: "10000"},
Expand Down Expand Up @@ -145,7 +144,6 @@ var noopSysVars = []*SysVar{
{Scope: ScopeGlobal, Name: DelayKeyWrite, Value: On, Type: TypeEnum, PossibleValues: []string{Off, On, "ALL"}},
{Scope: ScopeNone, Name: "metadata_locks_cache_size", Value: "1024"},
{Scope: ScopeNone, Name: "innodb_force_recovery", Value: "0"},
{Scope: ScopeGlobal, Name: "innodb_file_format_max", Value: "Antelope"},
{Scope: ScopeGlobal | ScopeSession, Name: "debug", Value: ""},
{Scope: ScopeGlobal, Name: "log_warnings", Value: "1"},
{Scope: ScopeGlobal | ScopeSession, Name: InnodbStrictMode, Value: On, Type: TypeBool, AutoConvertNegativeBool: true},
Expand All @@ -156,15 +154,12 @@ var noopSysVars = []*SysVar{
Value: "262144",
IsHintUpdatableVerified: true,
},
{Scope: ScopeNone, Name: "innodb_mirrored_log_groups", Value: "1"},
{Scope: ScopeGlobal, Name: "max_binlog_size", Value: "1073741824"},
{Scope: ScopeGlobal, Name: "concurrent_insert", Value: "AUTO"},
{Scope: ScopeGlobal, Name: InnodbAdaptiveHashIndex, Value: On, Type: TypeBool, AutoConvertNegativeBool: true},
{Scope: ScopeGlobal, Name: InnodbFtEnableStopword, Value: On, Type: TypeBool, AutoConvertNegativeBool: true},
{Scope: ScopeGlobal, Name: "general_log_file", Value: "/usr/local/mysql/data/localhost.log"},
{Scope: ScopeGlobal | ScopeSession, Name: InnodbSupportXA, Value: "1"},
{Scope: ScopeGlobal, Name: "innodb_compression_level", Value: "6"},
{Scope: ScopeNone, Name: "innodb_file_format_check", Value: "1"},
{Scope: ScopeNone, Name: "myisam_mmap_size", Value: "18446744073709551615"},
{Scope: ScopeNone, Name: "innodb_buffer_pool_instances", Value: "8"},
{
Expand Down Expand Up @@ -211,7 +206,6 @@ var noopSysVars = []*SysVar{
{Scope: ScopeGlobal, Name: "innodb_spin_wait_delay", Value: "6"},
{Scope: ScopeGlobal, Name: "thread_cache_size", Value: "9"},
{Scope: ScopeGlobal, Name: LogSlowAdminStatements, Value: Off, Type: TypeBool},
{Scope: ScopeNone, Name: "innodb_checksums", Type: TypeBool, Value: On},
{Scope: ScopeNone, Name: "ft_stopword_file", Value: "(built-in)"},
{Scope: ScopeGlobal, Name: "innodb_max_dirty_pages_pct_lwm", Value: "0"},
{Scope: ScopeGlobal, Name: LogQueriesNotUsingIndexes, Value: Off, Type: TypeBool},
Expand Down Expand Up @@ -269,7 +263,6 @@ var noopSysVars = []*SysVar{
{Scope: ScopeNone, Name: "innodb_api_enable_binlog", Value: "0"},
{Scope: ScopeGlobal | ScopeSession, Name: "innodb_ft_user_stopword_table", Value: ""},
{Scope: ScopeNone, Name: "server_id_bits", Value: "32"},
{Scope: ScopeGlobal, Name: "innodb_log_checksum_algorithm", Value: ""},
{Scope: ScopeNone, Name: "innodb_buffer_pool_load_at_startup", Value: "1"},
{
Scope: ScopeGlobal | ScopeSession,
Expand All @@ -278,7 +271,6 @@ var noopSysVars = []*SysVar{
IsHintUpdatableVerified: true,
},
{Scope: ScopeGlobal, Name: "innodb_flush_neighbors", Value: "1"},
{Scope: ScopeNone, Name: "innodb_use_sys_malloc", Value: "1"},
{Scope: ScopeNone, Name: "performance_schema_max_socket_classes", Value: "10"},
{Scope: ScopeNone, Name: "performance_schema_max_stage_classes", Value: "150"},
{Scope: ScopeGlobal, Name: "innodb_purge_batch_size", Value: "300"},
Expand Down Expand Up @@ -421,7 +413,6 @@ var noopSysVars = []*SysVar{
{Scope: ScopeNone, Name: "innodb_read_only", Value: "0"},
{Scope: ScopeGlobal, Name: "log_syslog", Value: ""},
{Scope: ScopeGlobal | ScopeSession, Name: "transaction_alloc_block_size", Value: "8192"},
{Scope: ScopeGlobal, Name: "innodb_large_prefix", Type: TypeBool, Value: On},
{Scope: ScopeNone, Name: "performance_schema_max_cond_classes", Value: "80"},
{Scope: ScopeGlobal, Name: "innodb_io_capacity", Value: "200"},
{Scope: ScopeGlobal, Name: "max_binlog_cache_size", Value: "18446744073709547520"},
Expand Down Expand Up @@ -478,7 +469,6 @@ var noopSysVars = []*SysVar{
{Scope: ScopeGlobal | ScopeSession, Name: KeepFilesOnCreate, Value: Off, Type: TypeBool},
{Scope: ScopeNone, Name: "innodb_data_file_path", Value: "ibdata1:12M:autoextend"},
{Scope: ScopeNone, Name: "performance_schema_setup_actors_size", Value: "100"},
{Scope: ScopeNone, Name: "innodb_additional_mem_pool_size", Value: "8388608"},
{Scope: ScopeNone, Name: "log_error", Value: "/usr/local/mysql/data/localhost.err"},
{Scope: ScopeGlobal, Name: "binlog_stmt_cache_size", Value: "32768"},
{Scope: ScopeNone, Name: "relay_log_info_file", Value: "relay-log.info"},
Expand All @@ -505,7 +495,6 @@ var noopSysVars = []*SysVar{
Value: "65536",
IsHintUpdatableVerified: true,
},
{Scope: ScopeGlobal, Name: "innodb_stats_sample_pages", Value: "8"},
{Scope: ScopeGlobal | ScopeSession, Name: "profiling_history_size", Value: "15"},
{Scope: ScopeNone, Name: "have_symlink", Value: "YES"},
{Scope: ScopeGlobal | ScopeSession, Name: "storage_engine", Value: "InnoDB"},
Expand Down Expand Up @@ -568,14 +557,12 @@ var noopSysVars = []*SysVar{
{Scope: ScopeNone, Name: "myisam_recover_options", Value: Off},
{Scope: ScopeGlobal | ScopeSession, Name: NetBufferLength, Value: "16384", Type: TypeUnsigned, MinValue: 1024, MaxValue: 1048576},
{Scope: ScopeGlobal | ScopeSession, Name: "binlog_row_image", Value: "FULL"},
{Scope: ScopeNone, Name: "innodb_locks_unsafe_for_binlog", Value: "0"},
{Scope: ScopeSession, Name: "rbr_exec_mode", Value: ""},
{Scope: ScopeGlobal, Name: "myisam_max_sort_file_size", Value: "9223372036853727232"},
{Scope: ScopeNone, Name: "back_log", Value: "80"},
{Scope: ScopeSession, Name: "pseudo_thread_id", Value: ""},
{Scope: ScopeNone, Name: "have_dynamic_loading", Value: "YES"},
{Scope: ScopeGlobal, Name: "rewriter_verbose", Value: ""},
{Scope: ScopeGlobal, Name: "innodb_undo_logs", Value: "128"},
{Scope: ScopeNone, Name: "performance_schema_max_cond_instances", Value: "3504"},
{Scope: ScopeGlobal, Name: "delayed_insert_limit", Value: "100"},
{Scope: ScopeGlobal, Name: Flush, Value: Off, Type: TypeBool},
Expand Down
2 changes: 0 additions & 2 deletions pkg/sessionctx/variable/sysvar.go
Original file line number Diff line number Diff line change
Expand Up @@ -3710,8 +3710,6 @@ const (
InnodbAdaptiveHashIndex = "innodb_adaptive_hash_index"
// InnodbFtEnableStopword is the name for 'innodb_ft_enable_stopword' system variable.
InnodbFtEnableStopword = "innodb_ft_enable_stopword" // #nosec G101
// InnodbSupportXA is the name for 'innodb_support_xa' system variable.
InnodbSupportXA = "innodb_support_xa"
// InnodbOptimizeFullTextOnly is the name for 'innodb_optimize_fulltext_only' system variable.
InnodbOptimizeFullTextOnly = "innodb_optimize_fulltext_only"
// InnodbStatusOutputLocks is the name for 'innodb_status_output_locks' system variable.
Expand Down
24 changes: 22 additions & 2 deletions tests/integrationtest/r/expression/misc.result
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,32 @@ innodb_default_row_format dynamic
SHOW VARIABLES LIKE 'character_set_server';
Variable_name Value
character_set_server utf8mb4
SHOW VARIABLES LIKE 'innodb_additional_mem_pool_size';
Variable_name Value
SHOW VARIABLES LIKE 'innodb_checksums';
Variable_name Value
SHOW VARIABLES LIKE 'innodb_file_format';
Variable_name Value
innodb_file_format Barracuda
SHOW VARIABLES LIKE 'innodb_file_format_check';
Variable_name Value
SHOW VARIABLES LIKE 'innodb_file_format_max';
Variable_name Value
SHOW VARIABLES LIKE 'innodb_large_prefix';
Variable_name Value
innodb_large_prefix ON
SHOW VARIABLES LIKE 'innodb_locks_unsafe_for_binlog';
Variable_name Value
SHOW VARIABLES LIKE 'innodb_log_checksum_algorithm';
Variable_name Value
SHOW VARIABLES LIKE 'innodb_mirrored_log_groups';
Variable_name Value
SHOW VARIABLES LIKE 'innodb_stats_sample_pages';
Variable_name Value
SHOW VARIABLES LIKE 'innodb_support_xa';
Variable_name Value
SHOW VARIABLES LIKE 'innodb_undo_logs';
Variable_name Value
SHOW VARIABLES LIKE 'innodb_use_sys_malloc';
Variable_name Value
drop table if exists t;
create table t (c1 varchar(100), c2 varchar(128));
prepare pr1 from "insert into t values(ifnull(?,' '),ifnull(?,' '))";
Expand Down
14 changes: 14 additions & 0 deletions tests/integrationtest/t/expression/misc.test
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,22 @@ set global innodb_default_row_format = dynamic;
set global innodb_default_row_format = 'dynamic';
SHOW VARIABLES LIKE 'innodb_default_row_format';
SHOW VARIABLES LIKE 'character_set_server';

# Removed InnoDB variables, these are from before MySQL 8.0
# https://github.com/pingcap/tidb/issues/9142
SHOW VARIABLES LIKE 'innodb_additional_mem_pool_size';
SHOW VARIABLES LIKE 'innodb_checksums';
SHOW VARIABLES LIKE 'innodb_file_format';
SHOW VARIABLES LIKE 'innodb_file_format_check';
SHOW VARIABLES LIKE 'innodb_file_format_max';
SHOW VARIABLES LIKE 'innodb_large_prefix';
SHOW VARIABLES LIKE 'innodb_locks_unsafe_for_binlog';
SHOW VARIABLES LIKE 'innodb_log_checksum_algorithm';
SHOW VARIABLES LIKE 'innodb_mirrored_log_groups';
SHOW VARIABLES LIKE 'innodb_stats_sample_pages';
SHOW VARIABLES LIKE 'innodb_support_xa';
SHOW VARIABLES LIKE 'innodb_undo_logs';
SHOW VARIABLES LIKE 'innodb_use_sys_malloc';

# TestIfNullParamMarker
drop table if exists t;
Expand Down

0 comments on commit df44404

Please sign in to comment.