Commit b3817425 authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-11356 Option skip-core-file does not work

remove ancient hard-coded treatment of --core-file. This enables
normal my_getopt behavior for the already existing sysvar
parent e22a57da
...@@ -173,7 +173,7 @@ The following specify which files/extra groups are read (specified before remain ...@@ -173,7 +173,7 @@ The following specify which files/extra groups are read (specified before remain
ALWAYS ALWAYS
--console Write error output on screen; don't remove the console --console Write error output on screen; don't remove the console
window on windows. window on windows.
--core-file Write core on errors. --core-file Write core on crashes
-h, --datadir=name Path to the database root directory -h, --datadir=name Path to the database root directory
--date-format=name The DATE format (ignored) --date-format=name The DATE format (ignored)
--datetime-format=name --datetime-format=name
...@@ -1441,6 +1441,7 @@ column-compression-zlib-wrap FALSE ...@@ -1441,6 +1441,7 @@ column-compression-zlib-wrap FALSE
completion-type NO_CHAIN completion-type NO_CHAIN
concurrent-insert AUTO concurrent-insert AUTO
console TRUE console TRUE
core-file TRUE
date-format %Y-%m-%d date-format %Y-%m-%d
datetime-format %Y-%m-%d %H:%i:%s datetime-format %Y-%m-%d %H:%i:%s
deadlock-search-depth-long 15 deadlock-search-depth-long 15
......
...@@ -645,13 +645,13 @@ COMMAND_LINE_ARGUMENT REQUIRED ...@@ -645,13 +645,13 @@ COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME CORE_FILE VARIABLE_NAME CORE_FILE
VARIABLE_SCOPE GLOBAL VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN VARIABLE_TYPE BOOLEAN
VARIABLE_COMMENT write a core-file on crashes VARIABLE_COMMENT Write core on crashes
NUMERIC_MIN_VALUE NULL NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON ENUM_VALUE_LIST OFF,ON
READ_ONLY YES READ_ONLY YES
COMMAND_LINE_ARGUMENT NULL COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME DATADIR VARIABLE_NAME DATADIR
VARIABLE_SCOPE GLOBAL VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR VARIABLE_TYPE VARCHAR
......
...@@ -645,13 +645,13 @@ COMMAND_LINE_ARGUMENT REQUIRED ...@@ -645,13 +645,13 @@ COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME CORE_FILE VARIABLE_NAME CORE_FILE
VARIABLE_SCOPE GLOBAL VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN VARIABLE_TYPE BOOLEAN
VARIABLE_COMMENT write a core-file on crashes VARIABLE_COMMENT Write core on crashes
NUMERIC_MIN_VALUE NULL NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON ENUM_VALUE_LIST OFF,ON
READ_ONLY YES READ_ONLY YES
COMMAND_LINE_ARGUMENT NULL COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME DATADIR VARIABLE_NAME DATADIR
VARIABLE_SCOPE GLOBAL VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR VARIABLE_TYPE VARCHAR
......
...@@ -6754,8 +6754,6 @@ struct my_option my_long_options[]= ...@@ -6754,8 +6754,6 @@ struct my_option my_long_options[]=
{"console", OPT_CONSOLE, "Write error output on screen; don't remove the console window on windows.", {"console", OPT_CONSOLE, "Write error output on screen; don't remove the console window on windows.",
&opt_console, &opt_console, 0, GET_BOOL, NO_ARG, 0, 0, 0, &opt_console, &opt_console, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0}, 0, 0, 0},
{"core-file", OPT_WANT_CORE, "Write core on errors.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef DBUG_OFF #ifdef DBUG_OFF
{"debug", '#', "Built in DBUG debugger. Disabled in this build.", {"debug", '#', "Built in DBUG debugger. Disabled in this build.",
&current_dbug_option, &current_dbug_option, 0, GET_STR, OPT_ARG, &current_dbug_option, &current_dbug_option, 0, GET_STR, OPT_ARG,
...@@ -8542,9 +8540,6 @@ mysqld_get_one_option(int optid, const struct my_option *opt, char *argument) ...@@ -8542,9 +8540,6 @@ mysqld_get_one_option(int optid, const struct my_option *opt, char *argument)
case (int) OPT_SKIP_HOST_CACHE: case (int) OPT_SKIP_HOST_CACHE:
opt_specialflag|= SPECIAL_NO_HOST_CACHE; opt_specialflag|= SPECIAL_NO_HOST_CACHE;
break; break;
case (int) OPT_WANT_CORE:
test_flags |= TEST_CORE_ON_SIGNAL;
break;
case OPT_CONSOLE: case OPT_CONSOLE:
if (opt_console) if (opt_console)
opt_error_log= 0; // Force logs to stdout opt_error_log= 0; // Force logs to stdout
......
...@@ -531,10 +531,9 @@ bool check_has_super(sys_var *self, THD *thd, set_var *var) ...@@ -531,10 +531,9 @@ bool check_has_super(sys_var *self, THD *thd, set_var *var)
return false; return false;
} }
static Sys_var_bit Sys_core_file("core_file", "write a core-file on crashes", static Sys_var_bit Sys_core_file("core_file", "Write core on crashes",
READ_ONLY GLOBAL_VAR(test_flags), NO_CMD_LINE, READ_ONLY GLOBAL_VAR(test_flags), CMD_LINE(OPT_ARG),
TEST_CORE_ON_SIGNAL, DEFAULT(IF_WIN(TRUE,FALSE)), NO_MUTEX_GUARD, NOT_IN_BINLOG, TEST_CORE_ON_SIGNAL, DEFAULT(IF_WIN(TRUE,FALSE)));
0,0,0);
static bool binlog_format_check(sys_var *self, THD *thd, set_var *var) static bool binlog_format_check(sys_var *self, THD *thd, set_var *var)
{ {
......
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