Skip to content

Commit 399edc7

Browse files
committed
MDEV-37784 fix the warning
cannot add new warnings in 11.8 anymore: * remove ER_WARN_DEFAULT_SYNTAX * use ER_VARIABLE_IGNORED instead * change the wording in it to be more generic * simplified new_mode warning-printing code
1 parent 1668695 commit 399edc7

13 files changed

+51
-58
lines changed

mysql-test/main/mysql_tzinfo_to_sql_symlink.result

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_t
105105
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');
106106
SET session alter_algorithm=@old_alter_alg;
107107
Warnings:
108-
Warning 4200 The variable '@@alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release
108+
Warning 4200 The setting 'alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release
109109
Warnings:
110-
Warning 4200 The variable '@@alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release
110+
Warning 4200 The setting 'alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release
111111
SELECT COUNT(*) FROM time_zone;
112112
COUNT(*)
113113
2
@@ -166,9 +166,9 @@ SET SESSION SQL_LOG_BIN=@save_sql_log_bin;
166166
execute immediate if(@wsrep_is_on, 'SET SESSION WSREP_ON=@save_wsrep_on', 'do 0');
167167
SET session alter_algorithm=@old_alter_alg;
168168
Warnings:
169-
Warning 4200 The variable '@@alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release
169+
Warning 4200 The setting 'alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release
170170
Warnings:
171-
Warning 4200 The variable '@@alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release
171+
Warning 4200 The setting 'alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release
172172
SELECT COUNT(*) FROM time_zone;
173173
COUNT(*)
174174
2
@@ -490,9 +490,9 @@ execute immediate if(@wsrep_is_on, 'SET SESSION WSREP_ON=@save_wsrep_on', 'do 0'
490490
#
491491
set sql_mode=only_full_group_by;
492492
Warnings:
493-
Warning 4200 The variable '@@alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release
493+
Warning 4200 The setting 'alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release
494494
Warnings:
495-
Warning 4200 The variable '@@alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release
495+
Warning 4200 The setting 'alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release
496496
SELECT COUNT(*) FROM time_zone;
497497
COUNT(*)
498498
2

mysql-test/main/repair.result

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,16 +307,16 @@ COMMAND_LINE_ARGUMENT OPTIONAL
307307
GLOBAL_VALUE_PATH NULL
308308
set alter_algorithm=COPY;
309309
Warnings:
310-
Warning 4200 The variable '@@alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release
310+
Warning 4200 The setting 'alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release
311311
select @@alter_algorithm;
312312
@@alter_algorithm
313313
DEFAULT
314314
set statement alter_algorithm=COPY FOR SELECT @@alter_algorithm;
315315
@@alter_algorithm
316316
DEFAULT
317317
Warnings:
318-
Warning 4200 The variable '@@alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release
319-
Warning 4200 The variable '@@alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release
318+
Warning 4200 The setting 'alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release
319+
Warning 4200 The setting 'alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release
320320
# restart: --alter-algorithm=COPY
321321
select @@alter_algorithm;
322322
@@alter_algorithm

mysql-test/main/secondary_key_costs.result

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ explain select * from t1 where nm like '500%' AND fl2 = 0;
2929
id select_type table type possible_keys key key_len ref rows Extra
3030
1 SIMPLE t1 range idx1,idx2 idx1 35 NULL 1 Using index condition; Using where
3131
Warnings:
32-
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
33-
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
32+
Warning 4200 The setting 'optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release
33+
Warning 4200 The setting 'optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release
3434
set @trace=(select trace from information_schema.optimizer_trace);
3535
select json_detailed(json_extract(@trace, '$**.considered_access_paths'));
3636
json_detailed(json_extract(@trace, '$**.considered_access_paths'))
@@ -97,8 +97,8 @@ explain select * from t1 where nm like '500%' AND fl2 = 0;
9797
id select_type table type possible_keys key key_len ref rows Extra
9898
1 SIMPLE t1 range idx1,idx2 idx1 35 NULL 1 Using index condition; Using where
9999
Warnings:
100-
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
101-
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
100+
Warning 4200 The setting 'optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release
101+
Warning 4200 The setting 'optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release
102102
set @trace=(select trace from information_schema.optimizer_trace);
103103
select json_detailed(json_extract(@trace, '$**.considered_access_paths'));
104104
json_detailed(json_extract(@trace, '$**.considered_access_paths'))
@@ -163,14 +163,14 @@ select @@optimizer_adjust_secondary_key_costs;
163163
0
164164
set @@optimizer_adjust_secondary_key_costs=7;
165165
Warnings:
166-
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
166+
Warning 4200 The setting 'optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release
167167
Warning 1292 Truncated incorrect optimizer_adjust_secondary_ke... value: '7'
168168
select @@optimizer_adjust_secondary_key_costs;
169169
@@optimizer_adjust_secondary_key_costs
170170
2
171171
set @@optimizer_adjust_secondary_key_costs=default;
172172
Warnings:
173-
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
173+
Warning 4200 The setting 'optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release
174174
#
175175
# MDEV-34664: fix_innodb_cardinality
176176
#
@@ -201,7 +201,7 @@ id select_type table type possible_keys key key_len ref rows Extra
201201
1 SIMPLE t1 ref b b 5 test.t2.a 90 Using index
202202
set @@optimizer_adjust_secondary_key_costs=8;
203203
Warnings:
204-
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
204+
Warning 4200 The setting 'optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release
205205
Warning 1292 Truncated incorrect optimizer_adjust_secondary_ke... value: '8'
206206
explain select * from t1,t2 where t1.b=t2.a;
207207
id select_type table type possible_keys key key_len ref rows Extra
@@ -238,4 +238,4 @@ set global userstat=@save_userstat;
238238
set global innodb_stats_persistent_sample_pages=@save_ispsp;
239239
set @@optimizer_adjust_secondary_key_costs=default;
240240
Warnings:
241-
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
241+
Warning 4200 The setting 'optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release

mysql-test/suite/sys_vars/r/alter_algorithm_basic.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ SELECT @@global.alter_algorithm;
44
DEFAULT
55
SET GLOBAL alter_algorithm=2;
66
Warnings:
7-
Warning 4200 The variable '@@alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release
7+
Warning 4200 The setting 'alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release
88
SELECT @@global.alter_algorithm;
99
@@global.alter_algorithm
1010
DEFAULT
@@ -15,7 +15,7 @@ SELECT @@global.alter_algorithm;
1515
DEFAULT
1616
SET SESSION alter_algorithm=INSTANT;
1717
Warnings:
18-
Warning 4200 The variable '@@alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release
18+
Warning 4200 The setting 'alter_algorithm' is ignored. It only exists for compatibility with old installations and will be removed in a future release
1919
SHOW SESSION VARIABLES LIKE 'alter_algorithm';
2020
Variable_name Value
2121
alter_algorithm DEFAULT

mysql-test/suite/sys_vars/r/innodb_purge_rseg_truncate_frequency_basic.result

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ SELECT @global_start_value;
55
'#--------------------FN_DYNVARS_046_01------------------------#'
66
SET @@global.innodb_purge_rseg_truncate_frequency = 1;
77
Warnings:
8-
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
8+
Warning 4200 The setting 'innodb_purge_rseg_truncate_frequency' is ignored. It only exists for compatibility with old installations and will be removed in a future release
99
SET @@global.innodb_purge_rseg_truncate_frequency = DEFAULT;
1010
Warnings:
11-
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
11+
Warning 4200 The setting 'innodb_purge_rseg_truncate_frequency' is ignored. It only exists for compatibility with old installations and will be removed in a future release
1212
SELECT @@global.innodb_purge_rseg_truncate_frequency;
1313
@@global.innodb_purge_rseg_truncate_frequency
1414
128
@@ -22,40 +22,40 @@ SELECT local.innodb_purge_rseg_truncate_frequency;
2222
ERROR 42S02: Unknown table 'local' in SELECT
2323
SET global innodb_purge_rseg_truncate_frequency = 1;
2424
Warnings:
25-
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
25+
Warning 4200 The setting 'innodb_purge_rseg_truncate_frequency' is ignored. It only exists for compatibility with old installations and will be removed in a future release
2626
SELECT @@global.innodb_purge_rseg_truncate_frequency;
2727
@@global.innodb_purge_rseg_truncate_frequency
2828
1
2929
'#--------------------FN_DYNVARS_046_03------------------------#'
3030
SET @@global.innodb_purge_rseg_truncate_frequency = 1;
3131
Warnings:
32-
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
32+
Warning 4200 The setting 'innodb_purge_rseg_truncate_frequency' is ignored. It only exists for compatibility with old installations and will be removed in a future release
3333
SELECT @@global.innodb_purge_rseg_truncate_frequency;
3434
@@global.innodb_purge_rseg_truncate_frequency
3535
1
3636
SET @@global.innodb_purge_rseg_truncate_frequency = 1;
3737
Warnings:
38-
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
38+
Warning 4200 The setting 'innodb_purge_rseg_truncate_frequency' is ignored. It only exists for compatibility with old installations and will be removed in a future release
3939
SELECT @@global.innodb_purge_rseg_truncate_frequency;
4040
@@global.innodb_purge_rseg_truncate_frequency
4141
1
4242
SET @@global.innodb_purge_rseg_truncate_frequency = 128;
4343
Warnings:
44-
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
44+
Warning 4200 The setting 'innodb_purge_rseg_truncate_frequency' is ignored. It only exists for compatibility with old installations and will be removed in a future release
4545
SELECT @@global.innodb_purge_rseg_truncate_frequency;
4646
@@global.innodb_purge_rseg_truncate_frequency
4747
128
4848
'#--------------------FN_DYNVARS_046_05-------------------------#'
4949
SET @@global.innodb_purge_rseg_truncate_frequency = -1;
5050
Warnings:
51-
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
51+
Warning 4200 The setting 'innodb_purge_rseg_truncate_frequency' is ignored. It only exists for compatibility with old installations and will be removed in a future release
5252
Warning 1292 Truncated incorrect innodb_purge_rseg_truncate_fr... value: '-1'
5353
SELECT @@global.innodb_purge_rseg_truncate_frequency;
5454
@@global.innodb_purge_rseg_truncate_frequency
5555
1
5656
SET @@global.innodb_purge_rseg_truncate_frequency = -1024;
5757
Warnings:
58-
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
58+
Warning 4200 The setting 'innodb_purge_rseg_truncate_frequency' is ignored. It only exists for compatibility with old installations and will be removed in a future release
5959
Warning 1292 Truncated incorrect innodb_purge_rseg_truncate_fr... value: '-1024'
6060
SELECT @@global.innodb_purge_rseg_truncate_frequency;
6161
@@global.innodb_purge_rseg_truncate_frequency
@@ -113,20 +113,20 @@ SELECT @@global.innodb_purge_rseg_truncate_frequency;
113113
'#---------------------FN_DYNVARS_046_08----------------------#'
114114
SET @@global.innodb_purge_rseg_truncate_frequency = TRUE;
115115
Warnings:
116-
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
116+
Warning 4200 The setting 'innodb_purge_rseg_truncate_frequency' is ignored. It only exists for compatibility with old installations and will be removed in a future release
117117
SELECT @@global.innodb_purge_rseg_truncate_frequency;
118118
@@global.innodb_purge_rseg_truncate_frequency
119119
1
120120
SET @@global.innodb_purge_rseg_truncate_frequency = FALSE;
121121
Warnings:
122-
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
122+
Warning 4200 The setting 'innodb_purge_rseg_truncate_frequency' is ignored. It only exists for compatibility with old installations and will be removed in a future release
123123
Warning 1292 Truncated incorrect innodb_purge_rseg_truncate_fr... value: '0'
124124
SELECT @@global.innodb_purge_rseg_truncate_frequency;
125125
@@global.innodb_purge_rseg_truncate_frequency
126126
1
127127
SET @@global.innodb_purge_rseg_truncate_frequency = @global_start_value;
128128
Warnings:
129-
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
129+
Warning 4200 The setting 'innodb_purge_rseg_truncate_frequency' is ignored. It only exists for compatibility with old installations and will be removed in a future release
130130
SELECT @@global.innodb_purge_rseg_truncate_frequency;
131131
@@global.innodb_purge_rseg_truncate_frequency
132132
128

mysql-test/suite/sys_vars/r/new_mode.result

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ SELECT @@session.new_mode;
2222

2323
SET @@session.new_mode = "FIX_DISK_TMPTABLE_COSTS,TEST_WARNING1";
2424
Warnings:
25-
Warning 4209 'TEST_WARNING1' is default and ignored
25+
Warning 4200 The setting 'new_mode=TEST_WARNING1' is ignored. It only exists for compatibility with old installations and will be removed in a future release
2626
SET @@session.new_mode = "FIX_DISK_TMPTABLE_COSTS,TEST_WARNING1,TEST_WARNING2";
2727
Warnings:
28-
Warning 4209 'TEST_WARNING1' is default and ignored
29-
Warning 4209 'TEST_WARNING2' is default and ignored
28+
Warning 4200 The setting 'new_mode=TEST_WARNING1' is ignored. It only exists for compatibility with old installations and will be removed in a future release
29+
Warning 4200 The setting 'new_mode=TEST_WARNING2' is ignored. It only exists for compatibility with old installations and will be removed in a future release
3030
SET @@session.new_mode = "FIX_DISK_TMPTABLE_COSTS,TEST_WARNING1,TEST_WARNING2,TEST_WARNING3";
3131
ERROR 42000: Variable 'new_mode' can't be set to the value of 'TEST_WARNING3'
3232
SET @@session.new_mode = "ALL";
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
call mtr.add_suppression('new_mode=TEST_WARNING1');
2+
FOUND 1 /new_mode=TEST_WARNING1/ in mysqld.1.err
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--new-mode=TEST_WARNING1
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
--source include/have_debug.inc
2+
--source include/not_embedded.inc
3+
4+
call mtr.add_suppression('new_mode=TEST_WARNING1');
5+
--let SEARCH_PATTERN=new_mode=TEST_WARNING1
6+
--let SEARCH_FILE=$MYSQLTEST_VARDIR/log/mysqld.1.err
7+
--source include/search_pattern_in_file.inc

sql/mysqld.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4267,6 +4267,7 @@ static int init_common_variables()
42674267
global_system_variables.lc_messages= my_default_lc_messages;
42684268
global_system_variables.errmsgs= my_default_lc_messages->errmsgs->errmsgs;
42694269
init_client_errs();
4270+
check_new_mode_value(NULL, &global_system_variables.new_behavior);
42704271
mysql_library_init(unused,unused,unused); /* for replication */
42714272
lex_init();
42724273
if (item_create_init())
@@ -8816,8 +8817,6 @@ static int get_options(int *argc_ptr, char ***argv_ptr)
88168817
OLD_MODE_COMPAT_5_1_CHECKSUM);
88178818
}
88188819

8819-
check_new_mode_value(NULL, &global_system_variables.new_behavior);
8820-
88218820
if (global_system_variables.net_buffer_length >
88228821
global_system_variables.max_allowed_packet)
88238822
{

0 commit comments

Comments
 (0)