From cc758332ba090214ae950e49ee014f32d6ed779c Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 14 Mar 2024 20:46:41 +0100 Subject: [PATCH] ER_VARIABLE_DELETED fix typos, adjust wording, fix plugins. plugins can have unused variables too. If they use a literal "Unused" string a compiler might or might not merge two identical strings into one (-fmerge-constants) and depending on that the server will or will not issue a "variable is ignored" warning. --- .../main/mysql_tzinfo_to_sql_symlink.result | 12 +++++----- mysql-test/main/repair.result | 6 ++--- mysql-test/main/secondary_key_costs.result | 8 +++---- .../galera/r/mariadb_tzinfo_to_sql.result | 16 +++++++------- .../sys_vars/r/alter_algorithm_basic.result | 4 ++-- ...purge_rseg_truncate_frequency_basic.result | 22 +++++++++---------- sql/set_var.cc | 5 +++-- sql/share/errmsg-utf8.txt | 4 ++-- 8 files changed, 39 insertions(+), 38 deletions(-) diff --git a/mysql-test/main/mysql_tzinfo_to_sql_symlink.result b/mysql-test/main/mysql_tzinfo_to_sql_symlink.result index b1ce3dea284..bcd6bfb2212 100644 --- a/mysql-test/main/mysql_tzinfo_to_sql_symlink.result +++ b/mysql-test/main/mysql_tzinfo_to_sql_symlink.result @@ -105,9 +105,9 @@ execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_t execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_transition_type ENGINE=', @time_zone_transition_type_engine, ', ORDER BY Time_zone_id, Transition_type_id'), 'do 0'); SET session alter_algorithm=@old_alter_alg; Warnings: -Warning 4200 The variable '@@alter_algorithm' is deleted and ignored. It it only exists for compatiblity with old installations +Warning 4200 The variable '@@alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release Warnings: -Warning 4200 The variable '@@alter_algorithm' is deleted and ignored. It it only exists for compatiblity with old installations +Warning 4200 The variable '@@alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release SELECT COUNT(*) FROM time_zone; COUNT(*) 2 @@ -166,9 +166,9 @@ SET SESSION SQL_LOG_BIN=@save_sql_log_bin; execute immediate if(@wsrep_is_on, 'SET SESSION WSREP_ON=@save_wsrep_on', 'do 0'); SET session alter_algorithm=@old_alter_alg; Warnings: -Warning 4200 The variable '@@alter_algorithm' is deleted and ignored. It it only exists for compatiblity with old installations +Warning 4200 The variable '@@alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release Warnings: -Warning 4200 The variable '@@alter_algorithm' is deleted and ignored. It it only exists for compatiblity with old installations +Warning 4200 The variable '@@alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release SELECT COUNT(*) FROM time_zone; COUNT(*) 2 @@ -490,9 +490,9 @@ execute immediate if(@wsrep_is_on, 'SET SESSION WSREP_ON=@save_wsrep_on', 'do 0' # set sql_mode=only_full_group_by; Warnings: -Warning 4200 The variable '@@alter_algorithm' is deleted and ignored. It it only exists for compatiblity with old installations +Warning 4200 The variable '@@alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release Warnings: -Warning 4200 The variable '@@alter_algorithm' is deleted and ignored. It it only exists for compatiblity with old installations +Warning 4200 The variable '@@alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release SELECT COUNT(*) FROM time_zone; COUNT(*) 2 diff --git a/mysql-test/main/repair.result b/mysql-test/main/repair.result index 35dd6df1805..c69cc2cf409 100644 --- a/mysql-test/main/repair.result +++ b/mysql-test/main/repair.result @@ -287,7 +287,7 @@ COMMAND_LINE_ARGUMENT OPTIONAL GLOBAL_VALUE_PATH NULL set alter_algorithm=COPY; Warnings: -Warning 4200 The variable '@@alter_algorithm' is deleted and ignored. It it only exists for compatiblity with old installations +Warning 4200 The variable '@@alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release select @@alter_algorithm; @@alter_algorithm DEFAULT @@ -295,8 +295,8 @@ set statement alter_algorithm=COPY FOR SELECT @@alter_algorithm; @@alter_algorithm DEFAULT Warnings: -Warning 4200 The variable '@@alter_algorithm' is deleted and ignored. It it only exists for compatiblity with old installations -Warning 4200 The variable '@@alter_algorithm' is deleted and ignored. It it only exists for compatiblity with old installations +Warning 4200 The variable '@@alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release +Warning 4200 The variable '@@alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release # restart: --alter-algorithm=COPY select @@alter_algorithm; @@alter_algorithm diff --git a/mysql-test/main/secondary_key_costs.result b/mysql-test/main/secondary_key_costs.result index fa890a4dd44..ca039c656dc 100644 --- a/mysql-test/main/secondary_key_costs.result +++ b/mysql-test/main/secondary_key_costs.result @@ -29,8 +29,8 @@ explain select * from t1 where nm like '500%' AND fl2 = 0; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range idx1,idx2 idx1 35 NULL 1 Using index condition; Using where Warnings: -Warning 4200 The variable '@@optimizer_adjust_secondary_key_costs' is deleted and ignored. It it only exists for compatiblity with old installations -Warning 4200 The variable '@@optimizer_adjust_secondary_key_costs' is deleted and ignored. It it only exists for compatiblity with old installations +Warning 4200 The variable '@@optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release +Warning 4200 The variable '@@optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release set @trace=(select trace from information_schema.optimizer_trace); select json_detailed(json_extract(@trace, '$**.considered_access_paths')); json_detailed(json_extract(@trace, '$**.considered_access_paths')) @@ -97,8 +97,8 @@ explain select * from t1 where nm like '500%' AND fl2 = 0; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range idx1,idx2 idx1 35 NULL 1 Using index condition; Using where Warnings: -Warning 4200 The variable '@@optimizer_adjust_secondary_key_costs' is deleted and ignored. It it only exists for compatiblity with old installations -Warning 4200 The variable '@@optimizer_adjust_secondary_key_costs' is deleted and ignored. It it only exists for compatiblity with old installations +Warning 4200 The variable '@@optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release +Warning 4200 The variable '@@optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release set @trace=(select trace from information_schema.optimizer_trace); select json_detailed(json_extract(@trace, '$**.considered_access_paths')); json_detailed(json_extract(@trace, '$**.considered_access_paths')) diff --git a/mysql-test/suite/galera/r/mariadb_tzinfo_to_sql.result b/mysql-test/suite/galera/r/mariadb_tzinfo_to_sql.result index 0888dd6ff5f..303bd0510af 100644 --- a/mysql-test/suite/galera/r/mariadb_tzinfo_to_sql.result +++ b/mysql-test/suite/galera/r/mariadb_tzinfo_to_sql.result @@ -21,9 +21,9 @@ SET @save_wsrep_mode=@@WSREP_MODE; # Apply on node_1 Warnings: -Warning 4200 The variable '@@alter_algorithm' is deleted and ignored. It it only exists for compatiblity with old installations +Warning 4200 The variable '@@alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release Warnings: -Warning 4200 The variable '@@alter_algorithm' is deleted and ignored. It it only exists for compatiblity with old installations +Warning 4200 The variable '@@alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release 'binlog stationary as expected' SELECT @wsrep_is_on, @wsrep_cannot_replicate_tz, @save_wsrep_on, @save_sql_log_bin, @@WSREP_ON, @@SQL_LOG_BIN; @wsrep_is_on @wsrep_cannot_replicate_tz @save_wsrep_on @save_sql_log_bin @@WSREP_ON @@SQL_LOG_BIN @@ -78,9 +78,9 @@ COUNT(*) connection node_1; SET GLOBAL WSREP_MODE='REPLICATE_ARIA,REPLICATE_MYISAM'; Warnings: -Warning 4200 The variable '@@alter_algorithm' is deleted and ignored. It it only exists for compatiblity with old installations +Warning 4200 The variable '@@alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release Warnings: -Warning 4200 The variable '@@alter_algorithm' is deleted and ignored. It it only exists for compatiblity with old installations +Warning 4200 The variable '@@alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release 'binlog stationary as expected' SELECT @wsrep_is_on, @wsrep_cannot_replicate_tz, @save_wsrep_on, @save_sql_log_bin, @@WSREP_ON, @@SQL_LOG_BIN; @wsrep_is_on @wsrep_cannot_replicate_tz @save_wsrep_on @save_sql_log_bin @@WSREP_ON @@SQL_LOG_BIN @@ -137,9 +137,9 @@ COUNT(*) connection node_1; Warnings: -Warning 4200 The variable '@@alter_algorithm' is deleted and ignored. It it only exists for compatiblity with old installations +Warning 4200 The variable '@@alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release Warnings: -Warning 4200 The variable '@@alter_algorithm' is deleted and ignored. It it only exists for compatiblity with old installations +Warning 4200 The variable '@@alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release 'binlog advanced as expected' SELECT @wsrep_is_on, @wsrep_cannot_replicate_tz, @save_wsrep_on, @save_sql_log_bin, @@WSREP_ON, @@SQL_LOG_BIN; @wsrep_is_on @wsrep_cannot_replicate_tz @save_wsrep_on @save_sql_log_bin @@WSREP_ON @@SQL_LOG_BIN @@ -199,9 +199,9 @@ TRUNCATE TABLE time_zone_leap_second; connection node_1; SET GLOBAL WSREP_MODE=''; Warnings: -Warning 4200 The variable '@@alter_algorithm' is deleted and ignored. It it only exists for compatiblity with old installations +Warning 4200 The variable '@@alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release Warnings: -Warning 4200 The variable '@@alter_algorithm' is deleted and ignored. It it only exists for compatiblity with old installations +Warning 4200 The variable '@@alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release 'binlog advanced as expected' SELECT @wsrep_is_on, @wsrep_cannot_replicate_tz, @save_wsrep_on, @save_sql_log_bin, @@WSREP_ON, @@SQL_LOG_BIN; @wsrep_is_on @wsrep_cannot_replicate_tz @save_wsrep_on @save_sql_log_bin @@WSREP_ON @@SQL_LOG_BIN diff --git a/mysql-test/suite/sys_vars/r/alter_algorithm_basic.result b/mysql-test/suite/sys_vars/r/alter_algorithm_basic.result index 33e01308753..042f897d8ec 100644 --- a/mysql-test/suite/sys_vars/r/alter_algorithm_basic.result +++ b/mysql-test/suite/sys_vars/r/alter_algorithm_basic.result @@ -4,7 +4,7 @@ SELECT @@global.alter_algorithm; DEFAULT SET GLOBAL alter_algorithm=2; Warnings: -Warning 4200 The variable '@@alter_algorithm' is deleted and ignored. It it only exists for compatiblity with old installations +Warning 4200 The variable '@@alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release SELECT @@global.alter_algorithm; @@global.alter_algorithm DEFAULT @@ -15,7 +15,7 @@ SELECT @@global.alter_algorithm; DEFAULT SET SESSION alter_algorithm=INSTANT; Warnings: -Warning 4200 The variable '@@alter_algorithm' is deleted and ignored. It it only exists for compatiblity with old installations +Warning 4200 The variable '@@alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release SHOW SESSION VARIABLES LIKE 'alter_algorithm'; Variable_name Value alter_algorithm DEFAULT diff --git a/mysql-test/suite/sys_vars/r/innodb_purge_rseg_truncate_frequency_basic.result b/mysql-test/suite/sys_vars/r/innodb_purge_rseg_truncate_frequency_basic.result index 8b5ae0fae3e..eb5181c5b47 100644 --- a/mysql-test/suite/sys_vars/r/innodb_purge_rseg_truncate_frequency_basic.result +++ b/mysql-test/suite/sys_vars/r/innodb_purge_rseg_truncate_frequency_basic.result @@ -5,10 +5,10 @@ SELECT @global_start_value; '#--------------------FN_DYNVARS_046_01------------------------#' SET @@global.innodb_purge_rseg_truncate_frequency = 1; Warnings: -Warning 1287 '@@innodb_purge_rseg_truncate_frequency' is deprecated and will be removed in a future release +Warning 4200 The variable '@@innodb_purge_rseg_truncate_frequency' is ignored. It only exists for compatibility with old installations and will be removed in a future release SET @@global.innodb_purge_rseg_truncate_frequency = DEFAULT; Warnings: -Warning 1287 '@@innodb_purge_rseg_truncate_frequency' is deprecated and will be removed in a future release +Warning 4200 The variable '@@innodb_purge_rseg_truncate_frequency' is ignored. It only exists for compatibility with old installations and will be removed in a future release SELECT @@global.innodb_purge_rseg_truncate_frequency; @@global.innodb_purge_rseg_truncate_frequency 128 @@ -22,40 +22,40 @@ SELECT local.innodb_purge_rseg_truncate_frequency; ERROR 42S02: Unknown table 'local' in field list SET global innodb_purge_rseg_truncate_frequency = 1; Warnings: -Warning 1287 '@@innodb_purge_rseg_truncate_frequency' is deprecated and will be removed in a future release +Warning 4200 The variable '@@innodb_purge_rseg_truncate_frequency' is ignored. It only exists for compatibility with old installations and will be removed in a future release SELECT @@global.innodb_purge_rseg_truncate_frequency; @@global.innodb_purge_rseg_truncate_frequency 1 '#--------------------FN_DYNVARS_046_03------------------------#' SET @@global.innodb_purge_rseg_truncate_frequency = 1; Warnings: -Warning 1287 '@@innodb_purge_rseg_truncate_frequency' is deprecated and will be removed in a future release +Warning 4200 The variable '@@innodb_purge_rseg_truncate_frequency' is ignored. It only exists for compatibility with old installations and will be removed in a future release SELECT @@global.innodb_purge_rseg_truncate_frequency; @@global.innodb_purge_rseg_truncate_frequency 1 SET @@global.innodb_purge_rseg_truncate_frequency = 1; Warnings: -Warning 1287 '@@innodb_purge_rseg_truncate_frequency' is deprecated and will be removed in a future release +Warning 4200 The variable '@@innodb_purge_rseg_truncate_frequency' is ignored. It only exists for compatibility with old installations and will be removed in a future release SELECT @@global.innodb_purge_rseg_truncate_frequency; @@global.innodb_purge_rseg_truncate_frequency 1 SET @@global.innodb_purge_rseg_truncate_frequency = 128; Warnings: -Warning 1287 '@@innodb_purge_rseg_truncate_frequency' is deprecated and will be removed in a future release +Warning 4200 The variable '@@innodb_purge_rseg_truncate_frequency' is ignored. It only exists for compatibility with old installations and will be removed in a future release SELECT @@global.innodb_purge_rseg_truncate_frequency; @@global.innodb_purge_rseg_truncate_frequency 128 '#--------------------FN_DYNVARS_046_05-------------------------#' SET @@global.innodb_purge_rseg_truncate_frequency = -1; Warnings: -Warning 1287 '@@innodb_purge_rseg_truncate_frequency' is deprecated and will be removed in a future release +Warning 4200 The variable '@@innodb_purge_rseg_truncate_frequency' is ignored. It only exists for compatibility with old installations and will be removed in a future release Warning 1292 Truncated incorrect innodb_purge_rseg_truncate_fr... value: '-1' SELECT @@global.innodb_purge_rseg_truncate_frequency; @@global.innodb_purge_rseg_truncate_frequency 1 SET @@global.innodb_purge_rseg_truncate_frequency = -1024; Warnings: -Warning 1287 '@@innodb_purge_rseg_truncate_frequency' is deprecated and will be removed in a future release +Warning 4200 The variable '@@innodb_purge_rseg_truncate_frequency' is ignored. It only exists for compatibility with old installations and will be removed in a future release Warning 1292 Truncated incorrect innodb_purge_rseg_truncate_fr... value: '-1024' SELECT @@global.innodb_purge_rseg_truncate_frequency; @@global.innodb_purge_rseg_truncate_frequency @@ -113,20 +113,20 @@ SELECT @@global.innodb_purge_rseg_truncate_frequency; '#---------------------FN_DYNVARS_046_08----------------------#' SET @@global.innodb_purge_rseg_truncate_frequency = TRUE; Warnings: -Warning 1287 '@@innodb_purge_rseg_truncate_frequency' is deprecated and will be removed in a future release +Warning 4200 The variable '@@innodb_purge_rseg_truncate_frequency' is ignored. It only exists for compatibility with old installations and will be removed in a future release SELECT @@global.innodb_purge_rseg_truncate_frequency; @@global.innodb_purge_rseg_truncate_frequency 1 SET @@global.innodb_purge_rseg_truncate_frequency = FALSE; Warnings: -Warning 1287 '@@innodb_purge_rseg_truncate_frequency' is deprecated and will be removed in a future release +Warning 4200 The variable '@@innodb_purge_rseg_truncate_frequency' is ignored. It only exists for compatibility with old installations and will be removed in a future release Warning 1292 Truncated incorrect innodb_purge_rseg_truncate_fr... value: '0' SELECT @@global.innodb_purge_rseg_truncate_frequency; @@global.innodb_purge_rseg_truncate_frequency 1 SET @@global.innodb_purge_rseg_truncate_frequency = @global_start_value; Warnings: -Warning 1287 '@@innodb_purge_rseg_truncate_frequency' is deprecated and will be removed in a future release +Warning 4200 The variable '@@innodb_purge_rseg_truncate_frequency' is ignored. It only exists for compatibility with old installations and will be removed in a future release SELECT @@global.innodb_purge_rseg_truncate_frequency; @@global.innodb_purge_rseg_truncate_frequency 128 diff --git a/sql/set_var.cc b/sql/set_var.cc index f3ed3e6e1b5..6f09490f715 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -430,8 +430,9 @@ void sys_var::do_deprecated_warning(THD *thd) char buf1[NAME_CHAR_LEN + 3]; strxnmov(buf1, sizeof(buf1)-1, "@@", name.str, 0); - if (option.comment == UNUSED_HELP) - my_error(ER_VARIABLE_DELETED, MYF(ME_WARNING), buf1); + if (option.comment == UNUSED_HELP || + strcmp(option.comment, UNUSED_HELP) == 0) + my_error(ER_VARIABLE_IGNORED, MYF(ME_WARNING), buf1); else { char buf2[NAME_CHAR_LEN + 3]; diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index a6c863a7267..c119aab82b7 100644 --- a/sql/share/errmsg-utf8.txt +++ b/sql/share/errmsg-utf8.txt @@ -12278,5 +12278,5 @@ ER_SEQUENCE_TABLE_CANNOT_HAVE_ANY_CONSTRAINTS eng "Sequence tables cannot have any constraints" ER_SEQUENCE_TABLE_ORDER_BY eng "ORDER BY" -ER_VARIABLE_DELETED - eng "The variable '%s' is deleted and ignored. It it only exists for compatiblity with old installations" +ER_VARIABLE_IGNORED + eng "The variable '%s' is ignored. It only exists for compatibility with old installations and will be removed in a future release"