Commit 75f5cc47 authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-30905 Remove old_alter_table variable

parent 98de1172
......@@ -1650,12 +1650,10 @@ ALTER TABLE m1 ENABLE KEYS, ALGORITHM= INPLACE;
affected rows: 0
ALTER TABLE t1 DROP INDEX i1, DROP INDEX i2, DROP INDEX i3, DROP INDEX i4;
#
# 2: Test ALGORITHM + old_alter_table
# 2: Test ALGORITHM + alter_algorithm
#
SET SESSION old_alter_table= 1;
SET SESSION alter_algorithm= 1;
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);
affected rows: 2
info: Records: 2 Duplicates: 0 Warnings: 0
......@@ -1674,10 +1672,8 @@ affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 1
Warnings:
Note 1831 Duplicate index `i4`. This is deprecated and will be disallowed in a future release
SET SESSION old_alter_table= 0;
SET SESSION alter_algorithm= 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;
#
# 3: Test unsupported in-place operation
......
......@@ -1462,16 +1462,16 @@ ALTER TABLE m1 ENABLE KEYS, ALGORITHM= INPLACE;
ALTER TABLE t1 DROP INDEX i1, DROP INDEX i2, DROP INDEX i3, DROP INDEX i4;
--echo #
--echo # 2: Test ALGORITHM + old_alter_table
--echo # 2: Test ALGORITHM + alter_algorithm
--echo #
--enable_info
SET SESSION old_alter_table= 1;
SET SESSION alter_algorithm= 1;
ALTER TABLE t1 ADD INDEX i1(b);
ALTER TABLE t1 ADD INDEX i2(b), ALGORITHM= DEFAULT;
ALTER TABLE t1 ADD INDEX i3(b), ALGORITHM= COPY;
ALTER TABLE t1 ADD INDEX i4(b), ALGORITHM= INPLACE;
SET SESSION old_alter_table= 0;
SET SESSION alter_algorithm= 0;
--disable_info
ALTER TABLE t1 DROP INDEX i1, DROP INDEX i2, DROP INDEX i3, DROP INDEX i4;
......
......@@ -2,7 +2,6 @@
# Bug 42074 concurrent optimize table and
# alter table = Assertion failed: thd->is_error()
#
DROP TABLE IF EXISTS t1;
# Create InnoDB table
CREATE TABLE t1 (id INT) engine=innodb;
connect con2, localhost, root;
......@@ -451,11 +450,9 @@ ALTER TABLE t1 ENGINE=INNODB;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
#ALTER TABLE FORCE, ALTER TABLE ENGINE and OPTIMIZE TABLE uses
#table copy when the old_alter_table enabled.
SET SESSION old_alter_table= TRUE;
#table copy when the alter_algorithm enabled.
SET SESSION alter_algorithm= TRUE;
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;
affected rows: 1
info: Records: 1 Duplicates: 0 Warnings: 0
......@@ -478,10 +475,8 @@ test.t1 optimize status OK
affected rows: 2
SET DEBUG_SYNC= 'RESET';
affected rows: 0
SET SESSION old_alter_table= FALSE;
SET SESSION alter_algorithm= FALSE;
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
#when ALGORITHM COPY is used.
ALTER TABLE t1 FORCE, ALGORITHM= COPY;
......
......@@ -14,10 +14,6 @@
--echo # alter table = Assertion failed: thd->is_error()
--echo #
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
--echo # Create InnoDB table
CREATE TABLE t1 (id INT) engine=innodb;
connect (con2, localhost, root);
......@@ -616,8 +612,8 @@ ALTER TABLE t1 FORCE;
ALTER TABLE t1 ENGINE=INNODB;
--echo #ALTER TABLE FORCE, ALTER TABLE ENGINE and OPTIMIZE TABLE uses
--echo #table copy when the old_alter_table enabled.
SET SESSION old_alter_table= TRUE;
--echo #table copy when the alter_algorithm enabled.
SET SESSION alter_algorithm= TRUE;
ALTER TABLE t1 FORCE;
ALTER TABLE t1 ENGINE= INNODB;
......@@ -632,7 +628,7 @@ INSERT INTO t1 VALUES(10, 20);
--connection default
--reap
SET DEBUG_SYNC= 'RESET';
SET SESSION old_alter_table= FALSE;
SET SESSION alter_algorithm= FALSE;
--echo #ALTER TABLE FORCE and ALTER TABLE ENGINE uses table copy
--echo #when ALGORITHM COPY is used.
......
......@@ -700,10 +700,6 @@ The following specify which files/extra groups are read (specified before remain
connection before aborting the write
--old Use compatible behavior from previous MariaDB version.
See also --old-mode
--old-alter-table[=name]
Alias for alter_algorithm. Deprecated. Use
--alter-algorithm instead.. One of: DEFAULT, COPY,
INPLACE, NOCOPY, INSTANT
--old-mode=name Used to emulate old behavior from earlier MariaDB or
MySQL versions. Any combination of:
NO_DUP_KEY_WARNINGS_WITH_IGNORE, NO_PROGRESS_INFO,
......@@ -1740,7 +1736,6 @@ net-read-timeout 30
net-retry-count 10
net-write-timeout 60
old FALSE
old-alter-table DEFAULT
old-mode UTF8_IS_UTF8MB3
old-passwords FALSE
old-style-user-limits FALSE
......
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
set alter_algorithm=0;
create table bug53592(a int) engine=innodb row_format=compact;
alter table bug53592 add column b text charset utf8;
alter table bug53592 add column c blob not null;
......@@ -14,9 +12,7 @@ check table bug53592;
Table Op Msg_type Msg_text
test.bug53592 check status OK
drop table bug53592;
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
set alter_algorithm=1;
create table bug53592(a int) engine=innodb row_format=compact;
alter table bug53592 add column b text charset utf8;
alter table bug53592 add column c blob not null;
......
......@@ -5,7 +5,7 @@
--source include/have_innodb.inc
# Use FIC for index creation
set old_alter_table=0;
set alter_algorithm=0;
create table bug53592(a int) engine=innodb row_format=compact;
......@@ -33,8 +33,8 @@ check table bug53592;
drop table bug53592;
# Running the same set of test when "old_alter_table" is turned on
set old_alter_table=1;
# Running the same set of test when "alter_algorithm" is turned on
set alter_algorithm=1;
create table bug53592(a int) engine=innodb row_format=compact;
......
SET @start_global_value = @@global.old_alter_table;
SELECT @start_global_value;
@start_global_value
DEFAULT
select @@global.old_alter_table;
@@global.old_alter_table
DEFAULT
select @@session.old_alter_table;
@@session.old_alter_table
DEFAULT
show global variables like 'old_alter_table';
Variable_name Value
old_alter_table DEFAULT
show session variables like 'old_alter_table';
Variable_name Value
old_alter_table DEFAULT
select * from information_schema.global_variables where variable_name='old_alter_table';
VARIABLE_NAME VARIABLE_VALUE
OLD_ALTER_TABLE DEFAULT
select * from information_schema.session_variables where variable_name='old_alter_table';
VARIABLE_NAME VARIABLE_VALUE
OLD_ALTER_TABLE DEFAULT
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;
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;
@@global.old_alter_table
COPY
select @@session.old_alter_table;
@@session.old_alter_table
COPY
show global variables like 'old_alter_table';
Variable_name Value
old_alter_table COPY
show session variables like 'old_alter_table';
Variable_name Value
old_alter_table COPY
select * from information_schema.global_variables where variable_name='old_alter_table';
VARIABLE_NAME VARIABLE_VALUE
OLD_ALTER_TABLE COPY
select * from information_schema.session_variables where variable_name='old_alter_table';
VARIABLE_NAME VARIABLE_VALUE
OLD_ALTER_TABLE COPY
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;
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;
@@global.old_alter_table
INPLACE
select @@session.old_alter_table;
@@session.old_alter_table
INPLACE
show global variables like 'old_alter_table';
Variable_name Value
old_alter_table INPLACE
show session variables like 'old_alter_table';
Variable_name Value
old_alter_table INPLACE
select * from information_schema.global_variables where variable_name='old_alter_table';
VARIABLE_NAME VARIABLE_VALUE
OLD_ALTER_TABLE INPLACE
select * from information_schema.session_variables where variable_name='old_alter_table';
VARIABLE_NAME VARIABLE_VALUE
OLD_ALTER_TABLE INPLACE
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;
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;
@@global.old_alter_table
NOCOPY
select @@session.old_alter_table;
@@session.old_alter_table
NOCOPY
show global variables like 'old_alter_table';
Variable_name Value
old_alter_table NOCOPY
show session variables like 'old_alter_table';
Variable_name Value
old_alter_table NOCOPY
select * from information_schema.global_variables where variable_name='old_alter_table';
VARIABLE_NAME VARIABLE_VALUE
OLD_ALTER_TABLE NOCOPY
select * from information_schema.session_variables where variable_name='old_alter_table';
VARIABLE_NAME VARIABLE_VALUE
OLD_ALTER_TABLE NOCOPY
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;
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;
@@global.old_alter_table
INSTANT
select @@session.old_alter_table;
@@session.old_alter_table
INSTANT
show global variables like 'old_alter_table';
Variable_name Value
old_alter_table INSTANT
show session variables like 'old_alter_table';
Variable_name Value
old_alter_table INSTANT
select * from information_schema.global_variables where variable_name='old_alter_table';
VARIABLE_NAME VARIABLE_VALUE
OLD_ALTER_TABLE INSTANT
select * from information_schema.session_variables where variable_name='old_alter_table';
VARIABLE_NAME VARIABLE_VALUE
OLD_ALTER_TABLE INSTANT
set global old_alter_table=1.1;
ERROR 42000: Incorrect argument type to variable 'old_alter_table'
set global old_alter_table=1e1;
ERROR 42000: Incorrect argument type to variable 'old_alter_table'
set global old_alter_table="foo";
ERROR 42000: Variable 'old_alter_table' can't be set to the value of 'foo'
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;
@@global.old_alter_table
DEFAULT
......@@ -2272,16 +2272,6 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME OLD_ALTER_TABLE
VARIABLE_SCOPE SESSION
VARIABLE_TYPE ENUM
VARIABLE_COMMENT Alias for alter_algorithm. Deprecated. Use --alter-algorithm instead.
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST DEFAULT,COPY,INPLACE,NOCOPY,INSTANT
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME OLD_MODE
VARIABLE_SCOPE SESSION
VARIABLE_TYPE SET
......
......@@ -2472,16 +2472,6 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME OLD_ALTER_TABLE
VARIABLE_SCOPE SESSION
VARIABLE_TYPE ENUM
VARIABLE_COMMENT Alias for alter_algorithm. Deprecated. Use --alter-algorithm instead.
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST DEFAULT,COPY,INPLACE,NOCOPY,INSTANT
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME OLD_MODE
VARIABLE_SCOPE SESSION
VARIABLE_TYPE SET
......
#
# 2010-01-20 OBN - added check of I_S values after variable value changed
#
SET @start_global_value = @@global.old_alter_table;
SELECT @start_global_value;
#
# exists as global and session
#
select @@global.old_alter_table;
select @@session.old_alter_table;
show global variables like 'old_alter_table';
show session variables like 'old_alter_table';
select * from information_schema.global_variables where variable_name='old_alter_table';
select * from information_schema.session_variables where variable_name='old_alter_table';
#
# show that it's writable
#
set global old_alter_table=1;
set session old_alter_table=1;
select @@global.old_alter_table;
select @@session.old_alter_table;
show global variables like 'old_alter_table';
show session variables like 'old_alter_table';
select * from information_schema.global_variables where variable_name='old_alter_table';
select * from information_schema.session_variables where variable_name='old_alter_table';
set global old_alter_table=2;
set session old_alter_table=2;
select @@global.old_alter_table;
select @@session.old_alter_table;
show global variables like 'old_alter_table';
show session variables like 'old_alter_table';
select * from information_schema.global_variables where variable_name='old_alter_table';
select * from information_schema.session_variables where variable_name='old_alter_table';
set global old_alter_table=3;
set session old_alter_table=3;
select @@global.old_alter_table;
select @@session.old_alter_table;
show global variables like 'old_alter_table';
show session variables like 'old_alter_table';
select * from information_schema.global_variables where variable_name='old_alter_table';
select * from information_schema.session_variables where variable_name='old_alter_table';
set global old_alter_table=4;
set session old_alter_table=4;
select @@global.old_alter_table;
select @@session.old_alter_table;
show global variables like 'old_alter_table';
show session variables like 'old_alter_table';
select * from information_schema.global_variables where variable_name='old_alter_table';
select * from information_schema.session_variables where variable_name='old_alter_table';
#
# incorrect types
#
--error ER_WRONG_TYPE_FOR_VAR
set global old_alter_table=1.1;
--error ER_WRONG_TYPE_FOR_VAR
set global old_alter_table=1e1;
--error ER_WRONG_VALUE_FOR_VAR
set global old_alter_table="foo";
SET @@global.old_alter_table = @start_global_value;
SELECT @@global.old_alter_table;
......@@ -2782,14 +2782,6 @@ static Sys_var_enum Sys_alter_algorithm(
SESSION_VAR(alter_algorithm), CMD_LINE(OPT_ARG),
alter_algorithm_modes, DEFAULT(0));
static Sys_var_enum Sys_old_alter_table(
"old_alter_table", "Alias for alter_algorithm. "
"Deprecated. Use --alter-algorithm instead.",
SESSION_VAR(alter_algorithm), CMD_LINE(OPT_ARG),
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)
{
return mysql_user_table_is_in_short_password_format;
......
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