Skip to content

Commit

Permalink
MDEV-30905 Remove old_alter_table variable
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvova committed Aug 2, 2023
1 parent 98de117 commit 75f5cc4
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 265 deletions.
10 changes: 3 additions & 7 deletions mysql-test/main/alter_table.result
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions mysql-test/main/alter_table.test
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
11 changes: 3 additions & 8 deletions mysql-test/main/innodb_mysql_sync.result
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -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;
Expand Down
10 changes: 3 additions & 7 deletions mysql-test/main/innodb_mysql_sync.test
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;

Expand All @@ -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.
Expand Down
5 changes: 0 additions & 5 deletions mysql-test/main/mysqld--help.result
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
8 changes: 2 additions & 6 deletions mysql-test/suite/innodb/r/innodb_bug53592.result
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
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;
Expand All @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions mysql-test/suite/innodb/t/innodb_bug53592.test
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down
130 changes: 0 additions & 130 deletions mysql-test/suite/sys_vars/r/old_alter_table_basic.result

This file was deleted.

10 changes: 0 additions & 10 deletions mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 0 additions & 10 deletions mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit 75f5cc4

Please sign in to comment.