From 66f55a018bb3a6cc3e68dd4578f487c18a2fa639 Mon Sep 17 00:00:00 2001 From: Nayuta Yanagisawa Date: Tue, 15 Feb 2022 16:18:55 +0900 Subject: MDEV-27730 Add PLUGIN_VAR_DEPRECATED flag to plugin variables The sys_var class has the deprecation_substitute member to mark the deprecated variables. As it's set, the server produces warnings when these variables are used. However, the plugin has no means to utilize that functionality. So, the PLUGIN_VAR_DEPRECATED flag is introduced to set the deprecation_substitute with the empty string. A non-empty string can make the warning more informative, but there's no nice way seen to specify it, and not that needed at the moment. --- storage/example/ha_example.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'storage/example') diff --git a/storage/example/ha_example.cc b/storage/example/ha_example.cc index ab402c636d1..8785281c242 100644 --- a/storage/example/ha_example.cc +++ b/storage/example/ha_example.cc @@ -1054,12 +1054,17 @@ static MYSQL_THDVAR_DOUBLE( 1000.5, 0); +static MYSQL_THDVAR_INT( + deprecated_var, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_DEPRECATED, "-1..1", + NULL, NULL, 0, -1, 1, 0); + static struct st_mysql_sys_var* example_system_variables[]= { MYSQL_SYSVAR(enum_var), MYSQL_SYSVAR(ulong_var), MYSQL_SYSVAR(int_var), MYSQL_SYSVAR(double_var), MYSQL_SYSVAR(double_thdvar), + MYSQL_SYSVAR(deprecated_var), MYSQL_SYSVAR(varopt_default), NULL }; -- cgit v1.2.1