revision-id: c3555380abc86e424c854f76d9371a5f93aab1cd (mariadb-10.1.34-29-gc3555380abc) parent(s): 46b3b77167242d97069e197ffe2fef25d6e53170 author: Oleksandr Byelkin committer: Oleksandr Byelkin timestamp: 2018-07-20 17:35:24 +0200 message: postreview --- client/mysqlbinlog.cc | 2 +- sql/mysqld.cc | 3 ++- sql/mysqld.h | 3 ++- sql/sys_vars.cc | 6 ++++-- sql/sys_vars.ic | 31 ------------------------------- 5 files changed, 9 insertions(+), 36 deletions(-) diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 9753125dd67..bc13aa6c2cc 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -71,7 +71,7 @@ ulong bytes_sent = 0L, bytes_received = 0L; ulong mysqld_net_retry_count = 10L; ulong open_files_limit; ulong opt_binlog_rows_event_max_size; -uint test_flags = 0; +ulonglong test_flags = 0; static uint opt_protocol= 0; static FILE *result_file; static char *result_file_name= 0; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 0f5147c8cf1..1e6e144ccff 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -482,7 +482,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, test_flags, select_errors, dropping_tables, ha_open_options; +uint mysqld_port, select_errors, dropping_tables, ha_open_options; uint mysqld_extra_port; uint mysqld_port_timeout; ulong delay_key_write_options; @@ -509,6 +509,7 @@ ulonglong max_binlog_cache_size=0; ulong slave_max_allowed_packet= 0; ulonglong binlog_stmt_cache_size=0; ulonglong max_binlog_stmt_cache_size=0; +ulonglong test_flags; ulonglong query_cache_size=0; ulong query_cache_limit=0; ulong executed_events=0; diff --git a/sql/mysqld.h b/sql/mysqld.h index 97ecf889787..0a3266abfb5 100644 --- a/sql/mysqld.h +++ b/sql/mysqld.h @@ -159,7 +159,8 @@ extern ulong opt_tc_log_size, tc_log_max_pages_used, tc_log_page_size; extern ulong tc_log_page_waits; extern my_bool relay_log_purge, opt_innodb_safe_binlog, opt_innodb; extern my_bool relay_log_recovery; -extern uint test_flags,select_errors,ha_open_options; +extern uint select_errors,ha_open_options; +extern ulonglong test_flags; extern uint protocol_version, mysqld_port, dropping_tables; extern ulong delay_key_write_options; extern char *opt_logname, *opt_slow_logname, *opt_bin_logname, diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index c6e4b87ae25..f941794f89e 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -441,8 +441,10 @@ bool check_has_super(sys_var *self, THD *thd, set_var *var) return false; } -static Sys_var_test_flag Sys_core_file( - "core_file", "write a core-file on crashes", TEST_CORE_ON_SIGNAL); +static Sys_var_bit Sys_core_file("core_file", "write a core-file on crashes", + READ_ONLY GLOBAL_VAR(test_flags), NO_CMD_LINE, + TEST_CORE_ON_SIGNAL, DEFAULT(FALSE), NO_MUTEX_GUARD, NOT_IN_BINLOG, + 0,0,0); static bool binlog_format_check(sys_var *self, THD *thd, set_var *var) { diff --git a/sql/sys_vars.ic b/sql/sys_vars.ic index f90d81fa8c4..cbc10c85351 100644 --- a/sql/sys_vars.ic +++ b/sql/sys_vars.ic @@ -1059,37 +1059,6 @@ class Sys_var_double: public sys_var { var->save_result.double_value= getopt_ulonglong2double(option.def_value); } }; - -/** - The class for @test_flags (core_file for now). - It's derived from Sys_var_mybool. - - Class specific constructor arguments: - Caller need not pass in a variable as we make up the value on the - fly, that is, we derive it from the global test_flags bit vector. - - Backing store: my_bool -*/ -class Sys_var_test_flag: public Sys_var_mybool -{ -private: - my_bool test_flag_value; - uint test_flag_mask; -public: - Sys_var_test_flag(const char *name_arg, const char *comment, uint mask) - : Sys_var_mybool(name_arg, comment, READ_ONLY GLOBAL_VAR(test_flag_value), - NO_CMD_LINE, DEFAULT(FALSE), NO_MUTEX_GUARD, NOT_IN_BINLOG, - 0, 0, 0) - { - test_flag_mask= mask; - } - uchar *global_value_ptr(THD *thd, const LEX_STRING *base) - { - test_flag_value= ((test_flags & test_flag_mask) > 0); - return (uchar*) &test_flag_value; - } -}; - /** The class for the @max_user_connections. It's derived from Sys_var_uint, but non-standard session value