mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01:00
Fix that one cannot change value for deleted variables
This enasures that the 'variables that only exists for compatibility' are always kept as its default value. Based on an idea from Sergei Golubchik
This commit is contained in:
parent
8af7a99443
commit
6254fcf84a
3 changed files with 8 additions and 6 deletions
|
@ -133,6 +133,7 @@ double getopt_double_limit_value(double num, const struct my_option *optp,
|
|||
|
||||
ulonglong getopt_double2ulonglong(double);
|
||||
double getopt_ulonglong2double(ulonglong);
|
||||
void my_getopt_init_one_value(const struct my_option *, void *, longlong);
|
||||
|
||||
static inline void convert_underscore_to_dash(char *str, size_t len)
|
||||
{
|
||||
|
|
|
@ -36,7 +36,6 @@ static longlong getopt_ll(char *arg, const struct my_option *optp, int *err);
|
|||
static ulonglong getopt_ull(char *, const struct my_option *, int *);
|
||||
static double getopt_double(char *arg, const struct my_option *optp, int *err);
|
||||
static void init_variables(const struct my_option *, init_func_p);
|
||||
static void init_one_value(const struct my_option *, void *, longlong);
|
||||
static void fini_one_value(const struct my_option *, void *, longlong);
|
||||
static int setval(const struct my_option *, void *, char *, my_bool, const char *);
|
||||
static char *check_struct_option(char *cur_arg, char *key_name);
|
||||
|
@ -278,7 +277,7 @@ int handle_options(int *argc, char ***argv, const struct my_option *longopts,
|
|||
(*argc)--; /* Skip the program name */
|
||||
(*argv)++; /* --- || ---- */
|
||||
if (my_handle_options_init_variables)
|
||||
init_variables(longopts, init_one_value);
|
||||
init_variables(longopts, my_getopt_init_one_value);
|
||||
|
||||
is_cmdline_arg= !is_file_marker(**argv);
|
||||
|
||||
|
@ -1381,13 +1380,13 @@ static double getopt_double(char *arg, const struct my_option *optp, int *err)
|
|||
Init one value to it's default values
|
||||
|
||||
SYNOPSIS
|
||||
init_one_value()
|
||||
my_getopt_init_one_value()
|
||||
option Option to initialize
|
||||
value Pointer to variable
|
||||
*/
|
||||
|
||||
static void init_one_value(const struct my_option *option, void *variable,
|
||||
longlong value)
|
||||
void my_getopt_init_one_value(const struct my_option *option, void *variable,
|
||||
longlong value)
|
||||
{
|
||||
DBUG_ENTER("init_one_value");
|
||||
switch ((option->var_type & GET_TYPE_MASK)) {
|
||||
|
@ -1470,7 +1469,7 @@ static void init_one_value(const struct my_option *option, void *variable,
|
|||
Init one value to it's default values
|
||||
|
||||
SYNOPSIS
|
||||
init_one_value()
|
||||
fini_one_value()
|
||||
option Option to initialize
|
||||
value Pointer to variable
|
||||
*/
|
||||
|
|
|
@ -8059,6 +8059,8 @@ mysqld_get_one_option(const struct my_option *opt, const char *argument,
|
|||
case OPT_REMOVED_OPTION:
|
||||
sql_print_warning("'%s' was removed. It does nothing now and exists only "
|
||||
"for compatibility with old my.cnf files.", opt->name);
|
||||
/* Restore default value (to show that the option cannot be used) */
|
||||
my_getopt_init_one_value(opt, opt->value, opt->def_value);
|
||||
break;
|
||||
case OPT_MYSQL_COMPATIBILITY:
|
||||
sql_print_warning("'%s' is MySQL 5.6 / 5.7 compatible option. Not used or "
|
||||
|
|
Loading…
Reference in a new issue