summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <vicentiu@mariadb.org>2020-01-19 19:13:01 +0200
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2020-02-13 13:42:01 +0200
commit1bc9cce70273c7f4705fb193abd2c938e3f3402a (patch)
tree2eef2ec6e29d08a1d8c279378851c6e697fdd591 /sql
parent45bc7574fba26f3f975379b73d80235081c4d397 (diff)
downloadmariadb-git-1bc9cce70273c7f4705fb193abd2c938e3f3402a.tar.gz
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.
Diffstat (limited to 'sql')
-rw-r--r--sql/mysqld.cc14
-rw-r--r--sql/mysqld.h1
2 files changed, 13 insertions, 2 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 73499cdc7d6..08332672715 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -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);
diff --git a/sql/mysqld.h b/sql/mysqld.h
index 80e1876a70c..4f4e608e811 100644
--- a/sql/mysqld.h
+++ b/sql/mysqld.h
@@ -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,