Commit fc5a4cfd authored by Vicențiu Ciorbaru's avatar Vicențiu Ciorbaru

MDEV-18650: Options deprecated in previous versions - old_alter_table

It was deprecated in 5.5 but it never issued a deprecation warning.
Make it issue a warning in 10.5.1.
parent 899056cf
...@@ -1679,6 +1679,8 @@ ALTER TABLE t1 DROP INDEX i1, DROP INDEX i2, DROP INDEX i3, DROP INDEX i4; ...@@ -1679,6 +1679,8 @@ ALTER TABLE t1 DROP INDEX i1, DROP INDEX i2, DROP INDEX i3, DROP INDEX i4;
# #
SET SESSION old_alter_table= 1; SET SESSION old_alter_table= 1;
affected rows: 0 affected rows: 0
Warnings:
Warning 1287 '@@old_alter_table' is deprecated and will be removed in a future release. Please use '@@alter_algorithm' instead
ALTER TABLE t1 ADD INDEX i1(b); ALTER TABLE t1 ADD INDEX i1(b);
affected rows: 2 affected rows: 2
info: Records: 2 Duplicates: 0 Warnings: 0 info: Records: 2 Duplicates: 0 Warnings: 0
...@@ -1699,6 +1701,8 @@ Warnings: ...@@ -1699,6 +1701,8 @@ Warnings:
Note 1831 Duplicate index `i4`. This is deprecated and will be disallowed in a future release Note 1831 Duplicate index `i4`. This is deprecated and will be disallowed in a future release
SET SESSION old_alter_table= 0; SET SESSION old_alter_table= 0;
affected rows: 0 affected rows: 0
Warnings:
Warning 1287 '@@old_alter_table' is deprecated and will be removed in a future release. Please use '@@alter_algorithm' instead
ALTER TABLE t1 DROP INDEX i1, DROP INDEX i2, DROP INDEX i3, DROP INDEX i4; ALTER TABLE t1 DROP INDEX i1, DROP INDEX i2, DROP INDEX i3, DROP INDEX i4;
# #
# 3: Test unsupported in-place operation # 3: Test unsupported in-place operation
......
...@@ -450,6 +450,8 @@ info: Records: 0 Duplicates: 0 Warnings: 0 ...@@ -450,6 +450,8 @@ info: Records: 0 Duplicates: 0 Warnings: 0
#table copy when the old_alter_table enabled. #table copy when the old_alter_table enabled.
SET SESSION old_alter_table= TRUE; SET SESSION old_alter_table= TRUE;
affected rows: 0 affected rows: 0
Warnings:
Warning 1287 '@@old_alter_table' is deprecated and will be removed in a future release. Please use '@@alter_algorithm' instead
ALTER TABLE t1 FORCE; ALTER TABLE t1 FORCE;
affected rows: 1 affected rows: 1
info: Records: 1 Duplicates: 0 Warnings: 0 info: Records: 1 Duplicates: 0 Warnings: 0
...@@ -474,6 +476,8 @@ SET DEBUG_SYNC= 'RESET'; ...@@ -474,6 +476,8 @@ SET DEBUG_SYNC= 'RESET';
affected rows: 0 affected rows: 0
SET SESSION old_alter_table= FALSE; SET SESSION old_alter_table= FALSE;
affected rows: 0 affected rows: 0
Warnings:
Warning 1287 '@@old_alter_table' is deprecated and will be removed in a future release. Please use '@@alter_algorithm' instead
#ALTER TABLE FORCE and ALTER TABLE ENGINE uses table copy #ALTER TABLE FORCE and ALTER TABLE ENGINE uses table copy
#when ALGORITHM COPY is used. #when ALGORITHM COPY is used.
ALTER TABLE t1 FORCE, ALGORITHM= COPY; ALTER TABLE t1 FORCE, ALGORITHM= COPY;
......
set old_alter_table=0; set old_alter_table=0;
Warnings:
Warning 1287 '@@old_alter_table' is deprecated and will be removed in a future release. Please use '@@alter_algorithm' instead
create table bug53592(a int) engine=innodb row_format=compact; create table bug53592(a int) engine=innodb row_format=compact;
alter table bug53592 add column b text charset utf8; alter table bug53592 add column b text charset utf8;
alter table bug53592 add column c blob not null; alter table bug53592 add column c blob not null;
...@@ -13,6 +15,8 @@ Table Op Msg_type Msg_text ...@@ -13,6 +15,8 @@ Table Op Msg_type Msg_text
test.bug53592 check status OK test.bug53592 check status OK
drop table bug53592; drop table bug53592;
set old_alter_table=1; set old_alter_table=1;
Warnings:
Warning 1287 '@@old_alter_table' is deprecated and will be removed in a future release. Please use '@@alter_algorithm' instead
create table bug53592(a int) engine=innodb row_format=compact; create table bug53592(a int) engine=innodb row_format=compact;
alter table bug53592 add column b text charset utf8; alter table bug53592 add column b text charset utf8;
alter table bug53592 add column c blob not null; alter table bug53592 add column c blob not null;
......
...@@ -2,6 +2,8 @@ call mtr.add_suppression('InnoDB: Cannot add field.*because after adding it, the ...@@ -2,6 +2,8 @@ call mtr.add_suppression('InnoDB: Cannot add field.*because after adding it, the
SET GLOBAL innodb_file_per_table=on; SET GLOBAL innodb_file_per_table=on;
SET GLOBAL innodb_strict_mode=on; SET GLOBAL innodb_strict_mode=on;
set old_alter_table=0; set old_alter_table=0;
Warnings:
Warning 1287 '@@old_alter_table' is deprecated and will be removed in a future release. Please use '@@alter_algorithm' instead
CREATE TABLE bug53591(a text charset utf8 not null) CREATE TABLE bug53591(a text charset utf8 not null)
ENGINE=InnoDB KEY_BLOCK_SIZE=1; ENGINE=InnoDB KEY_BLOCK_SIZE=1;
ALTER TABLE bug53591 ADD PRIMARY KEY(a(220)); ALTER TABLE bug53591 ADD PRIMARY KEY(a(220));
......
...@@ -21,7 +21,11 @@ select * from information_schema.session_variables where variable_name='old_alte ...@@ -21,7 +21,11 @@ select * from information_schema.session_variables where variable_name='old_alte
VARIABLE_NAME VARIABLE_VALUE VARIABLE_NAME VARIABLE_VALUE
OLD_ALTER_TABLE DEFAULT OLD_ALTER_TABLE DEFAULT
set global old_alter_table=1; set global old_alter_table=1;
Warnings:
Warning 1287 '@@old_alter_table' is deprecated and will be removed in a future release. Please use '@@alter_algorithm' instead
set session old_alter_table=1; set session old_alter_table=1;
Warnings:
Warning 1287 '@@old_alter_table' is deprecated and will be removed in a future release. Please use '@@alter_algorithm' instead
select @@global.old_alter_table; select @@global.old_alter_table;
@@global.old_alter_table @@global.old_alter_table
COPY COPY
...@@ -41,7 +45,11 @@ select * from information_schema.session_variables where variable_name='old_alte ...@@ -41,7 +45,11 @@ select * from information_schema.session_variables where variable_name='old_alte
VARIABLE_NAME VARIABLE_VALUE VARIABLE_NAME VARIABLE_VALUE
OLD_ALTER_TABLE COPY OLD_ALTER_TABLE COPY
set global old_alter_table=2; set global old_alter_table=2;
Warnings:
Warning 1287 '@@old_alter_table' is deprecated and will be removed in a future release. Please use '@@alter_algorithm' instead
set session old_alter_table=2; set session old_alter_table=2;
Warnings:
Warning 1287 '@@old_alter_table' is deprecated and will be removed in a future release. Please use '@@alter_algorithm' instead
select @@global.old_alter_table; select @@global.old_alter_table;
@@global.old_alter_table @@global.old_alter_table
INPLACE INPLACE
...@@ -61,7 +69,11 @@ select * from information_schema.session_variables where variable_name='old_alte ...@@ -61,7 +69,11 @@ select * from information_schema.session_variables where variable_name='old_alte
VARIABLE_NAME VARIABLE_VALUE VARIABLE_NAME VARIABLE_VALUE
OLD_ALTER_TABLE INPLACE OLD_ALTER_TABLE INPLACE
set global old_alter_table=3; set global old_alter_table=3;
Warnings:
Warning 1287 '@@old_alter_table' is deprecated and will be removed in a future release. Please use '@@alter_algorithm' instead
set session old_alter_table=3; set session old_alter_table=3;
Warnings:
Warning 1287 '@@old_alter_table' is deprecated and will be removed in a future release. Please use '@@alter_algorithm' instead
select @@global.old_alter_table; select @@global.old_alter_table;
@@global.old_alter_table @@global.old_alter_table
NOCOPY NOCOPY
...@@ -81,7 +93,11 @@ select * from information_schema.session_variables where variable_name='old_alte ...@@ -81,7 +93,11 @@ select * from information_schema.session_variables where variable_name='old_alte
VARIABLE_NAME VARIABLE_VALUE VARIABLE_NAME VARIABLE_VALUE
OLD_ALTER_TABLE NOCOPY OLD_ALTER_TABLE NOCOPY
set global old_alter_table=4; set global old_alter_table=4;
Warnings:
Warning 1287 '@@old_alter_table' is deprecated and will be removed in a future release. Please use '@@alter_algorithm' instead
set session old_alter_table=4; set session old_alter_table=4;
Warnings:
Warning 1287 '@@old_alter_table' is deprecated and will be removed in a future release. Please use '@@alter_algorithm' instead
select @@global.old_alter_table; select @@global.old_alter_table;
@@global.old_alter_table @@global.old_alter_table
INSTANT INSTANT
...@@ -107,6 +123,8 @@ ERROR 42000: Incorrect argument type to variable 'old_alter_table' ...@@ -107,6 +123,8 @@ ERROR 42000: Incorrect argument type to variable 'old_alter_table'
set global old_alter_table="foo"; set global old_alter_table="foo";
ERROR 42000: Variable 'old_alter_table' can't be set to the value of 'foo' ERROR 42000: Variable 'old_alter_table' can't be set to the value of 'foo'
SET @@global.old_alter_table = @start_global_value; SET @@global.old_alter_table = @start_global_value;
Warnings:
Warning 1287 '@@old_alter_table' is deprecated and will be removed in a future release. Please use '@@alter_algorithm' instead
SELECT @@global.old_alter_table; SELECT @@global.old_alter_table;
@@global.old_alter_table @@global.old_alter_table
DEFAULT DEFAULT
...@@ -2486,7 +2486,9 @@ static Sys_var_enum Sys_old_alter_table( ...@@ -2486,7 +2486,9 @@ static Sys_var_enum Sys_old_alter_table(
"old_alter_table", "Alias for alter_algorithm. " "old_alter_table", "Alias for alter_algorithm. "
"Deprecated. Use --alter-algorithm instead.", "Deprecated. Use --alter-algorithm instead.",
SESSION_VAR(alter_algorithm), CMD_LINE(OPT_ARG), SESSION_VAR(alter_algorithm), CMD_LINE(OPT_ARG),
alter_algorithm_modes, DEFAULT(0)); alter_algorithm_modes, DEFAULT(0), NO_MUTEX_GUARD, NOT_IN_BINLOG,
ON_CHECK(0), ON_UPDATE(0),
DEPRECATED("'@@alter_algorithm'")); // Since 10.5.1
static bool check_old_passwords(sys_var *self, THD *thd, set_var *var) static bool check_old_passwords(sys_var *self, THD *thd, set_var *var)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment