Commit becc8372 authored by Robin Newhouse's avatar Robin Newhouse Committed by Andrew Hutchings

Delete unused global variables from mysqld.h

Several variables declared in mysqld.h appear to be old system variables
that have been left over after deprecation. Delete them using IDE
refactoring to automatically search for other uses. Most cases had no
other uses in the code.

slave_allow_batching had a test that was effectively unused, as the
result was only
-ERROR HY000: Unknown system variable 'slave_allow_batching'
so that was deleted as well.

Build and test still works without issue as expected.

All new code of the whole pull request, including one or several files
that are either new files or modified ones, are contributed under the
BSD-new license. I am contributing on behalf of my employer Amazon Web
Services.
parent 7c5fdc9b
SET @global_start_value = @@global.slave_allow_batching;
ERROR HY000: Unknown system variable 'slave_allow_batching'
'#--------------------FN_DYNVARS_145_01------------------------#'
'#---------------------FN_DYNVARS_145_02-------------------------#'
'#--------------------FN_DYNVARS_145_03------------------------#'
'#--------------------FN_DYNVARS_145_04-------------------------#'
'#-------------------FN_DYNVARS_145_05----------------------------#'
'#----------------------FN_DYNVARS_145_06------------------------#'
'#----------------------FN_DYNVARS_145_07------------------------#'
'#---------------------FN_DYNVARS_145_08-------------------------#'
'#---------------------FN_DYNVARS_145_09----------------------#'
############## mysql-test\t\slave_allow_batching_basic.test ####################
# #
# Variable Name: slave_allow_batching #
# Scope: GLOBAL & SESSION #
# Access Type: Dynamic #
# Data Type: Numeric #
# Default Value: 1 #
# Range: 1 - 65536 #
# #
# #
# Creation Date: 2008-02-07 #
# Author: Rizwan Maredia #
# #
# Description: Test Cases of Dynamic System Variable slave_allow_batching #
# that checks the behavior of this variable in the following ways #
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# #
################################################################################
--source include/load_sysvars.inc
########################################################################
# START OF slave_allow_batching TESTS #
########################################################################
################################################################################
# Saving initial value of slave_allow_batching in a temporary variable #
################################################################################
--Error ER_UNKNOWN_SYSTEM_VARIABLE
SET @global_start_value = @@global.slave_allow_batching;
--echo '#--------------------FN_DYNVARS_145_01------------------------#'
########################################################################
# Display the DEFAULT value of slave_allow_batching #
########################################################################
#SET @@global.slave_allow_batching = 1;
#SET @@global.slave_allow_batching = DEFAULT;
#SELECT @@global.slave_allow_batching;
--echo '#---------------------FN_DYNVARS_145_02-------------------------#'
#############################################################################
# Check if slave_allow_batching can be accessed with and without @@ sign #
#############################################################################
#--Error ER_GLOBAL_VARIABLE
#SET slave_allow_batching = 1;
#SELECT @@slave_allow_batching;
#--Error ER_UNKNOWN_TABLE
#SELECT global.slave_allow_batching;
#
#SET global slave_allow_batching = 1;
#SELECT @@global.slave_allow_batching;
--echo '#--------------------FN_DYNVARS_145_03------------------------#'
########################################################################
# Change the value of slave_allow_batching to a valid value #
########################################################################
#SET @@global.slave_allow_batching = 0;
#SELECT @@global.slave_allow_batching;
#SET @@global.slave_allow_batching = 1;
#SELECT @@global.slave_allow_batching;
--echo '#--------------------FN_DYNVARS_145_04-------------------------#'
###########################################################################
# Change the value of slave_allow_batching to invalid value #
###########################################################################
#--Error ER_WRONG_VALUE_FOR_VAR
#SET @@global.slave_allow_batching = -1;
#--Error ER_WRONG_VALUE_FOR_VAR
#SET @@global.slave_allow_batching = 2;
#--Error ER_WRONG_VALUE_FOR_VAR
#SET @@global.slave_allow_batching = "T";
#--Error ER_WRONG_VALUE_FOR_VAR
#SET @@global.slave_allow_batching = "Y";
#--Error ER_WRONG_VALUE_FOR_VAR
#SET @@global.slave_allow_batching = YES;
#--Error ER_WRONG_VALUE_FOR_VAR
#SET @@global.slave_allow_batching = ONN;
#--Error ER_WRONG_VALUE_FOR_VAR
#SET @@global.slave_allow_batching = OOF;
#--Error ER_WRONG_VALUE_FOR_VAR
#SET @@global.slave_allow_batching = 0FF;
#--Error ER_WRONG_VALUE_FOR_VAR
#SET @@global.slave_allow_batching = ' 1';
#--Error ER_WRONG_VALUE_FOR_VAR
#SET @@global.slave_allow_batching = NO;
--echo '#-------------------FN_DYNVARS_145_05----------------------------#'
###########################################################################
# Test if accessing session slave_allow_batching gives error #
###########################################################################
#--Error ER_GLOBAL_VARIABLE
#SET @@session.slave_allow_batching = 0;
#--Error ER_GLOBAL_VARIABLE
#SET @@slave_allow_batching = 0;
#--Error ER_GLOBAL_VARIABLE
#SET @@local.slave_allow_batching = 0;
#--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
#SELECT @@session.slave_allow_batching;
#--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
#SELECT @@local.slave_allow_batching;
--echo '#----------------------FN_DYNVARS_145_06------------------------#'
#########################################################################
# Check if the value in SESSION Table contains variable value #
#########################################################################
#SELECT count(VARIABLE_VALUE) FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='slave_allow_batching';
--echo '#----------------------FN_DYNVARS_145_07------------------------#'
#########################################################################
# Check if the value in GLOBAL Table matches value in variable #
#########################################################################
#SELECT IF(@@global.slave_allow_batching, "ON", "OFF") = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='slave_allow_batching';
#SELECT @@global.slave_allow_batching;
#SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='slave_allow_batching';
#--echo 'Bug: value in information schema does not match'
--echo '#---------------------FN_DYNVARS_145_08-------------------------#'
###################################################################
# Check if ON and OFF values can be used on variable #
###################################################################
#SET @@global.slave_allow_batching = OFF;
#SELECT @@global.slave_allow_batching;
#SET @@global.slave_allow_batching = ON;
#SELECT @@global.slave_allow_batching;
--echo '#---------------------FN_DYNVARS_145_09----------------------#'
###################################################################
# Check if TRUE and FALSE values can be used on variable #
###################################################################
#SET @@global.slave_allow_batching = TRUE;
#SELECT @@global.slave_allow_batching;
#SET @@global.slave_allow_batching = FALSE;
#SELECT @@global.slave_allow_batching;
##############################
# Restore initial value #
##############################
#SET @@global.slave_allow_batching = @global_start_value;
#SELECT @@global.slave_allow_batching;
###############################################################
# END OF slave_allow_batching TESTS #
###############################################################
......@@ -64,7 +64,6 @@
PSI_memory_key key_memory_log_event;
#endif
PSI_memory_key key_memory_Incident_log_event_message;
PSI_memory_key key_memory_Rows_query_log_event_rows_query;
/**
BINLOG_CHECKSUM variable.
......
......@@ -453,7 +453,7 @@ my_bool opt_master_verify_checksum= 0;
my_bool opt_slave_sql_verify_checksum= 1;
const char *binlog_format_names[]= {"MIXED", "STATEMENT", "ROW", NullS};
volatile sig_atomic_t calling_initgroups= 0; /**< Used in SIGSEGV handler. */
uint mysqld_port, select_errors, dropping_tables, ha_open_options;
uint mysqld_port, select_errors, ha_open_options;
uint mysqld_extra_port;
uint mysqld_port_timeout;
ulong delay_key_write_options;
......@@ -7902,7 +7902,7 @@ static int mysql_init_variables(void)
disable_log_notes= 0;
mqh_used= 0;
cleanup_done= 0;
select_errors= dropping_tables= ha_open_options=0;
select_errors= ha_open_options= 0;
THD_count::count= CONNECT::count= 0;
slave_open_temp_tables= 0;
opt_endinfo= using_udf_functions= 0;
......@@ -9787,33 +9787,22 @@ static PSI_memory_info all_server_memory[]=
{ &key_memory_locked_table_list, "Locked_tables_list::m_locked_tables_root", 0},
{ &key_memory_locked_thread_list, "display_table_locks", PSI_FLAG_THREAD},
{ &key_memory_thd_transactions, "THD::transactions::mem_root", PSI_FLAG_THREAD},
// { &key_memory_delegate, "Delegate::memroot", 0},
{ &key_memory_acl_mem, "sql_acl_mem", PSI_FLAG_GLOBAL},
{ &key_memory_acl_memex, "sql_acl_memex", PSI_FLAG_GLOBAL},
{ &key_memory_acl_cache, "acl_cache", PSI_FLAG_GLOBAL},
{ &key_memory_thd_main_mem_root, "thd::main_mem_root", PSI_FLAG_THREAD},
// { &key_memory_help, "help", 0},
// { &key_memory_new_frm_mem, "new_frm_mem", 0},
{ &key_memory_table_share, "TABLE_SHARE::mem_root", PSI_FLAG_GLOBAL}, /* table definition cache */
{ &key_memory_gdl, "gdl", 0},
{ &key_memory_table_triggers_list, "Table_triggers_list", 0},
// { &key_memory_servers, "servers", 0},
{ &key_memory_prepared_statement_map, "Prepared_statement_map", PSI_FLAG_THREAD},
{ &key_memory_prepared_statement_main_mem_root, "Prepared_statement::main_mem_root", PSI_FLAG_THREAD},
// { &key_memory_protocol_rset_root, "Protocol_local::m_rset_root", PSI_FLAG_THREAD},
// { &key_memory_warning_info_warn_root, "Warning_info::m_warn_root", PSI_FLAG_THREAD},
{ &key_memory_sp_cache, "THD::sp_cache", 0},
{ &key_memory_sp_head_main_root, "sp_head::main_mem_root", 0},
{ &key_memory_sp_head_execute_root, "sp_head::execute_mem_root", PSI_FLAG_THREAD},
{ &key_memory_sp_head_call_root, "sp_head::call_mem_root", PSI_FLAG_THREAD},
{ &key_memory_table_mapping_root, "table_mapping::m_mem_root", 0},
{ &key_memory_quick_range_select_root, "QUICK_RANGE_SELECT::alloc", PSI_FLAG_THREAD},
// { &key_memory_quick_index_merge_root, "QUICK_INDEX_MERGE_SELECT::alloc", PSI_FLAG_THREAD},
// { &key_memory_quick_ror_intersect_select_root, "QUICK_ROR_INTERSECT_SELECT::alloc", PSI_FLAG_THREAD},
// { &key_memory_quick_ror_union_select_root, "QUICK_ROR_UNION_SELECT::alloc", PSI_FLAG_THREAD},
// { &key_memory_quick_group_min_max_select_root, "QUICK_GROUP_MIN_MAX_SELECT::alloc", PSI_FLAG_THREAD},
// { &key_memory_test_quick_select_exec, "test_quick_select", PSI_FLAG_THREAD},
// { &key_memory_prune_partitions_exec, "prune_partitions::exec", 0},
{ &key_memory_binlog_recover_exec, "MYSQL_BIN_LOG::recover", 0},
{ &key_memory_blob_mem_storage, "Blob_mem_storage::storage", 0},
{ &key_memory_NAMED_ILINK_name, "NAMED_ILINK::name", 0},
......@@ -9822,17 +9811,12 @@ static PSI_memory_info all_server_memory[]=
{ &key_memory_queue_item, "Queue::queue_item", 0},
{ &key_memory_THD_db, "THD::db", 0},
{ &key_memory_user_var_entry, "user_var_entry", 0},
// { &key_memory_Slave_job_group_group_relay_log_name, "Slave_job_group::group_relay_log_name", 0},
{ &key_memory_Relay_log_info_group_relay_log_name, "Relay_log_info::group_relay_log_name", 0},
{ &key_memory_binlog_cache_mngr, "binlog_cache_mngr", 0},
{ &key_memory_binlog_gtid_index, "binlog_gtid_index", 0},
{ &key_memory_Row_data_memory_memory, "Row_data_memory::memory", 0},
// { &key_memory_Gtid_set_to_string, "Gtid_set::to_string", 0},
// { &key_memory_Gtid_state_to_string, "Gtid_state::to_string", 0},
// { &key_memory_Owned_gtids_to_string, "Owned_gtids::to_string", 0},
// { &key_memory_log_event, "Log_event", 0},
// { &key_memory_Incident_log_event_message, "Incident_log_event::message", 0},
// { &key_memory_Rows_query_log_event_rows_query, "Rows_query_log_event::rows_query", 0},
{ &key_memory_Sort_param_tmp_buffer, "Sort_param::tmp_buffer", 0},
{ &key_memory_Filesort_info_merge, "Filesort_info::merge", 0},
{ &key_memory_Filesort_info_record_pointers, "Filesort_info::record_pointers", 0},
......@@ -9845,7 +9829,6 @@ static PSI_memory_info all_server_memory[]=
{ &key_memory_User_level_lock, "User_level_lock", 0},
{ &key_memory_MYSQL_LOG_name, "MYSQL_LOG::name", 0},
{ &key_memory_TC_LOG_MMAP_pages, "TC_LOG_MMAP::pages", 0},
// { &key_memory_my_bitmap_map, "my_bitmap_map", 0},
{ &key_memory_QUICK_RANGE_SELECT_mrr_buf_desc, "QUICK_RANGE_SELECT::mrr_buf_desc", 0},
{ &key_memory_Event_queue_element_for_exec_names, "Event_queue_element_for_exec::names", 0},
{ &key_memory_my_str_malloc, "my_str_malloc", 0},
......@@ -9856,39 +9839,21 @@ static PSI_memory_info all_server_memory[]=
{ &key_memory_rpl_filter, "rpl_filter memory", 0},
{ &key_memory_errmsgs, "errmsgs", 0},
{ &key_memory_Gis_read_stream_err_msg, "Gis_read_stream::err_msg", 0},
// { &key_memory_Geometry_objects_data, "Geometry::ptr_and_wkb_data", 0},
{ &key_memory_MYSQL_LOCK, "MYSQL_LOCK", 0},
// { &key_memory_NET_buff, "NET::buff", 0},
// { &key_memory_NET_compress_packet, "NET::compress_packet", 0},
{ &key_memory_Event_scheduler_scheduler_param, "Event_scheduler::scheduler_param", 0},
// { &key_memory_Gtid_set_Interval_chunk, "Gtid_set::Interval_chunk", 0},
// { &key_memory_Owned_gtids_sidno_to_hash, "Owned_gtids::sidno_to_hash", 0},
// { &key_memory_Sid_map_Node, "Sid_map::Node", 0},
// { &key_memory_Gtid_state_group_commit_sidno, "Gtid_state::group_commit_sidno_locks", 0},
// { &key_memory_Mutex_cond_array_Mutex_cond, "Mutex_cond_array::Mutex_cond", 0},
{ &key_memory_TABLE_RULE_ENT, "TABLE_RULE_ENT", 0},
// { &key_memory_Rpl_info_table, "Rpl_info_table", 0},
{ &key_memory_Rpl_info_file_buffer, "Rpl_info_file::buffer", 0},
// { &key_memory_db_worker_hash_entry, "db_worker_hash_entry", 0},
// { &key_memory_rpl_slave_check_temp_dir, "rpl_slave::check_temp_dir", 0},
// { &key_memory_rpl_slave_command_buffer, "rpl_slave::command_buffer", 0},
{ &key_memory_binlog_ver_1_event, "binlog_ver_1_event", 0},
{ &key_memory_SLAVE_INFO, "SLAVE_INFO", 0},
{ &key_memory_binlog_pos, "binlog_pos", 0},
// { &key_memory_HASH_ROW_ENTRY, "HASH_ROW_ENTRY", 0},
{ &key_memory_binlog_statement_buffer, "binlog_statement_buffer", 0},
// { &key_memory_partition_syntax_buffer, "partition_syntax_buffer", 0},
// { &key_memory_READ_INFO, "READ_INFO", 0},
{ &key_memory_JOIN_CACHE, "JOIN_CACHE", 0},
// { &key_memory_TABLE_sort_io_cache, "TABLE::sort_io_cache", 0},
// { &key_memory_frm, "frm", 0},
{ &key_memory_Unique_sort_buffer, "Unique::sort_buffer", 0},
{ &key_memory_Unique_merge_buffer, "Unique::merge_buffer", 0},
{ &key_memory_TABLE, "TABLE", PSI_FLAG_GLOBAL}, /* Table cache */
// { &key_memory_frm_extra_segment_buff, "frm::extra_segment_buff", 0},
// { &key_memory_frm_form_pos, "frm::form_pos", 0},
{ &key_memory_frm_string, "frm::string", 0},
// { &key_memory_LOG_name, "LOG_name", 0},
{ &key_memory_DATE_TIME_FORMAT, "DATE_TIME_FORMAT", 0},
{ &key_memory_DDL_LOG_MEMORY_ENTRY, "DDL_LOG_MEMORY_ENTRY", 0},
{ &key_memory_ST_SCHEMA_TABLE, "ST_SCHEMA_TABLE", 0},
......@@ -9896,30 +9861,15 @@ static PSI_memory_info all_server_memory[]=
{ &key_memory_PROFILE, "PROFILE", 0},
{ &key_memory_global_system_variables, "global_system_variables", 0},
{ &key_memory_THD_variables, "THD::variables", 0},
// { &key_memory_Security_context, "Security_context", 0},
// { &key_memory_shared_memory_name, "Shared_memory_name", 0},
{ &key_memory_bison_stack, "bison_stack", 0},
{ &key_memory_THD_handler_tables_hash, "THD::handler_tables_hash", 0},
{ &key_memory_hash_index_key_buffer, "hash_index_key_buffer", 0},
{ &key_memory_dboptions_hash, "dboptions_hash", 0},
{ &key_memory_dbnames_cache, "dbnames_cache", 0},
{ &key_memory_user_conn, "user_conn", 0},
// { &key_memory_LOG_POS_COORD, "LOG_POS_COORD", 0},
// { &key_memory_XID_STATE, "XID_STATE", 0},
{ &key_memory_MPVIO_EXT_auth_info, "MPVIO_EXT::auth_info", 0},
// { &key_memory_opt_bin_logname, "opt_bin_logname", 0},
{ &key_memory_Query_cache, "Query_cache", PSI_FLAG_GLOBAL},
// { &key_memory_READ_RECORD_cache, "READ_RECORD_cache", 0},
// { &key_memory_Quick_ranges, "Quick_ranges", 0},
// { &key_memory_File_query_log_name, "File_query_log::name", 0},
{ &key_memory_Table_trigger_dispatcher, "Table_trigger_dispatcher::m_mem_root", 0},
// { &key_memory_thd_timer, "thd_timer", 0},
// { &key_memory_THD_Session_tracker, "THD::Session_tracker", 0},
// { &key_memory_THD_Session_sysvar_resource_manager, "THD::Session_sysvar_resource_manager", 0},
// { &key_memory_show_slave_status_io_gtid_set, "show_slave_status_io_gtid_set", 0},
// { &key_memory_write_set_extraction, "write_set_extraction", 0},
// { &key_memory_get_all_tables, "get_all_tables", 0},
// { &key_memory_fill_schema_schemata, "fill_schema_schemata", 0},
{ &key_memory_native_functions, "native_functions", PSI_FLAG_GLOBAL},
{ &key_memory_WSREP, "wsrep", 0 }
};
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment