Commit 1bc9cce7 authored by Vicențiu Ciorbaru's avatar Vicențiu Ciorbaru

Policy improvement for removed options and system variables

REMOVED OPTIONS / SYSTEM VARIABLES
  * mysqld removed options will not stop the server from starting. They
    will be silently accepted, as if --loose flag is set. Removed options
    prefixes will not interfere with existing options prefixes. They are
    consumed last.
  * mysqld removed options will not show in --help.
  * mysqld system variables will be removed according to the deprecation
    & removal timeline and not function within the client interface once
    removed.

DEPRECTATED OPTIONS / SYSTEM VARIABLES
  * mysqld deprecated options will issue a warning to the user.
  * mysqld deprecated options will still be visible in --help.
  * mysqld system variables will be removed in the next GA version that is
    past EOL of the version that deprecated the variable.
  * deprecated options / variables will not be used anywhere in the server
    code the moment they are deprecated. At most, they will act as aliases.

The advantage of this policy is that it ensures upgrades will always
allow the user to start the server, even when upgrading from a very old
version. It is still possible for user applications to break when
upgrading, as system variables set via the client interface will return
errors. However, this will happen after a long time, with lots of
warnings between versions. The expected timeline is ~ 5 years until a
deprecated variable dissapears from the server.
parent 45bc7574
......@@ -5044,8 +5044,12 @@ static int init_server_components()
if (remaining_argc > 1)
{
int ho_error;
struct my_option no_opts[]=
struct my_option removed_opts[]=
{
/* All options in this list are accepted by the server for backwards
compatibility, but do not have any effect otherwise, they behave
as if supplied with --loose. Whenever a deprecated option is removed
it should be appended here. */
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
/*
......@@ -5054,7 +5058,7 @@ static int init_server_components()
*/
my_getopt_skip_unknown= 0;
if ((ho_error= handle_options(&remaining_argc, &remaining_argv, no_opts,
if ((ho_error= handle_options(&remaining_argc, &remaining_argv, removed_opts,
mysqld_get_one_option)))
unireg_abort(ho_error);
/* Add back the program name handle_options removes */
......@@ -6387,6 +6391,10 @@ int handle_early_options()
{ option, OPT_MYSQL_COMPATIBILITY, \
0, 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0 }
#define MARIADB_REMOVED_OPTION(option) \
{ option, OPT_REMOVED_OPTION, \
0, 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0 }
/**
System variables are automatically command-line options (few
......@@ -8009,6 +8017,8 @@ mysqld_get_one_option(const struct my_option *opt, char *argument,
"for compatibility with old my.cnf files.",
opt->name);
break;
case OPT_REMOVED_OPTION:
break;
case OPT_MYSQL_COMPATIBILITY:
sql_print_warning("'%s' is MySQL 5.6 / 5.7 compatible option. Not used or "
"needed in MariaDB.", opt->name);
......
......@@ -655,6 +655,7 @@ enum options_mysqld
OPT_CONSOLE,
OPT_DEBUG_SYNC_TIMEOUT,
OPT_DEPRECATED_OPTION,
OPT_REMOVED_OPTION,
OPT_IGNORE_DB_DIRECTORY,
OPT_ISAM_LOG,
OPT_KEY_BUFFER_SIZE,
......
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