Commit 2501a0ea authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-7364 - mysqld --help --verbose prints random values for "debug"

better fix that doesn't make debug-dbug variable to disappear
from mysqld --help output (this fact is used by have_debug.inc)
and shows correctly what dbug value was set on the command line.
parent 3fcbd7cb
...@@ -1418,7 +1418,7 @@ my_bool plugins_are_initialized= FALSE; ...@@ -1418,7 +1418,7 @@ my_bool plugins_are_initialized= FALSE;
#ifndef DBUG_OFF #ifndef DBUG_OFF
static const char* default_dbug_option; static const char* default_dbug_option;
#endif #endif
static const char *current_dbug_option="disabled"; const char *current_dbug_option="";
#ifdef HAVE_LIBWRAP #ifdef HAVE_LIBWRAP
const char *libwrapName= NULL; const char *libwrapName= NULL;
int allow_severity = LOG_INFO; int allow_severity = LOG_INFO;
...@@ -8641,6 +8641,7 @@ mysqld_get_one_option(int optid, const struct my_option *opt, char *argument) ...@@ -8641,6 +8641,7 @@ mysqld_get_one_option(int optid, const struct my_option *opt, char *argument)
if (argument[0] == '1' && !argument[1]) if (argument[0] == '1' && !argument[1])
break; break;
DBUG_SET_INITIAL(argument); DBUG_SET_INITIAL(argument);
current_dbug_option= argument;
opt_endinfo=1; /* unireg: memory allocation */ opt_endinfo=1; /* unireg: memory allocation */
#else #else
sql_print_warning("'%s' is disabled in this build", opt->name); sql_print_warning("'%s' is disabled in this build", opt->name);
......
...@@ -105,6 +105,7 @@ extern my_bool read_only, opt_readonly; ...@@ -105,6 +105,7 @@ extern my_bool read_only, opt_readonly;
extern my_bool lower_case_file_system; extern my_bool lower_case_file_system;
extern my_bool opt_enable_named_pipe, opt_sync_frm, opt_allow_suspicious_udfs; extern my_bool opt_enable_named_pipe, opt_sync_frm, opt_allow_suspicious_udfs;
extern my_bool opt_secure_auth; extern my_bool opt_secure_auth;
extern const char *current_dbug_option;
extern char* opt_secure_file_priv; extern char* opt_secure_file_priv;
extern char* opt_secure_backup_file_priv; extern char* opt_secure_backup_file_priv;
extern size_t opt_secure_backup_file_priv_len; extern size_t opt_secure_backup_file_priv_len;
......
...@@ -742,7 +742,7 @@ public: ...@@ -742,7 +742,7 @@ public:
on_update_function on_update_func=0, on_update_function on_update_func=0,
const char *substitute=0) const char *substitute=0)
: sys_var(&all_sys_vars, name_arg, comment, flag_args, : sys_var(&all_sys_vars, name_arg, comment, flag_args,
- (ptrdiff_t) &global_system_variables, getopt.id, (char*)&current_dbug_option-(char*)&global_system_variables, getopt.id,
getopt.arg_type, SHOW_CHAR, (intptr)def_val, getopt.arg_type, SHOW_CHAR, (intptr)def_val,
lock, binlog_status_arg, on_check_func, on_update_func, lock, binlog_status_arg, on_check_func, on_update_func,
substitute) substitute)
......
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