1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-28671 Enable var deprecation for mysqld help output

Currently there are mechanism to mark a system variable as
deprecated, but they are only used to print warning messages
when a deprecated variable is set.

Leverage the existing mechanisms in order to make the
deprecation information available at the --help output of mysqld by:

* Moving the deprecation information (i.e `deprecation_substitute`
  attribute) from the `sys_var` class into the `my_option` struct.
  As every `sys_var` contains its own `my_option` struct, the access
  to the deprecation information remains available to `sys_var`
  objects. `my_getotp` functions, which works directly with
  `my_option` structs, gain access to this information while building
  the --help output.

* For plugin variables, leverages the `PLUGIN_VAR_DEPRECATED` flag
  and set the `deprecation_substitute` attribute  accordingly when
  building the `my_option` objects.

* Change the `option_cmp` function to use the `deprecation_substitute`
  attribute instead of the name when sorting the options. This way
  deprecated options and the substitutes will be grouped together.

All new code of the whole pull request, including one or several files
that are either new files or modified ones, are contributed under the
BSD-new license. I am contributing on behalf of my employer
Amazon Web Services, Inc.
This commit is contained in:
Christian Gonzalez
2023-05-17 19:21:29 +00:00
committed by Sergei Golubchik
parent 25094f339b
commit 4186fa72fb
41 changed files with 223 additions and 143 deletions

View File

@ -442,7 +442,7 @@ NOT NOT NULLIF(2,3)
#
CREATE TABLE t1 (a YEAR(2));
Warnings:
Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use 'YEAR(4)' instead
INSERT INTO t1 VALUES (0);
SELECT a,NULLIF(a,2000),NULLIF(2000,a) FROM t1;
a NULLIF(a,2000) NULLIF(2000,a)