mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
MDEV-33655 Remove alter_algorithm
Remove alter_algorithm but keep the variable as no-op (with a warning). The reasons for removing alter_algorithm are: - alter_algorithm was introduced as a replacement for the old_alter_table that was used to force the usage of the original alter table algorithm (copy) in the cases where the new alter algorithm did not work. The new option was added as a way to force the usage of a specific algorithm when it should instead have made it possible to disable algorithms that would not work for some reason. - alter_algorithm introduced some cases where ALTER TABLE would not work without specifying the ALGORITHM=XXX option together with ALTER TABLE. - Having different values of alter_algorithm on master and slave could cause slave to stop unexpectedly. - ALTER TABLE FORCE, as used by mariadb-upgrade, would not always work if alter_algorithm was set for the server. - As part of the MDEV-33449 "improving repair of tables" it become clear that alter- algorithm made it harder to provide a better and more consistent ALTER TABLE FORCE and REPAIR TABLE and it would be better to remove it.
This commit is contained in:
@ -449,63 +449,14 @@ info: Records: 0 Duplicates: 0 Warnings: 0
|
||||
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 alter_algorithm enabled.
|
||||
SET SESSION alter_algorithm= TRUE;
|
||||
affected rows: 0
|
||||
ALTER TABLE t1 FORCE;
|
||||
affected rows: 1
|
||||
info: Records: 1 Duplicates: 0 Warnings: 0
|
||||
ALTER TABLE t1 ENGINE= INNODB;
|
||||
affected rows: 1
|
||||
info: Records: 1 Duplicates: 0 Warnings: 0
|
||||
SET DEBUG_SYNC= 'alter_table_copy_after_lock_upgrade SIGNAL upgraded';
|
||||
affected rows: 0
|
||||
#OPTIMIZE TABLE operation using table copy.
|
||||
OPTIMIZE TABLE t1;
|
||||
connection con1;
|
||||
SET DEBUG_SYNC= 'now WAIT_FOR upgraded';
|
||||
affected rows: 0
|
||||
INSERT INTO t1 VALUES(10, 20);
|
||||
affected rows: 1
|
||||
connection default;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
|
||||
test.t1 optimize status OK
|
||||
affected rows: 2
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
affected rows: 0
|
||||
SET SESSION alter_algorithm= FALSE;
|
||||
affected rows: 0
|
||||
#ALTER TABLE FORCE and ALTER TABLE ENGINE uses table copy
|
||||
#when ALGORITHM COPY is used.
|
||||
# ALTER TABLE FORCE and ALTER TABLE ENGINE uses table copy
|
||||
# when ALGORITHM COPY is used.
|
||||
ALTER TABLE t1 FORCE, ALGORITHM= COPY;
|
||||
affected rows: 2
|
||||
info: Records: 2 Duplicates: 0 Warnings: 0
|
||||
affected rows: 1
|
||||
info: Records: 1 Duplicates: 0 Warnings: 0
|
||||
ALTER TABLE t1 ENGINE= INNODB, ALGORITHM= COPY;
|
||||
affected rows: 2
|
||||
info: Records: 2 Duplicates: 0 Warnings: 0
|
||||
DROP TABLE t1;
|
||||
#OPTIMIZE TABLE on a table with FULLTEXT index uses
|
||||
#ALTER TABLE FORCE using COPY algorithm here. This
|
||||
#test case ensures the COPY table debug sync point is hit.
|
||||
SET DEBUG_SYNC= 'alter_table_copy_after_lock_upgrade SIGNAL upgraded';
|
||||
#Setup a table with FULLTEXT index.
|
||||
connection default;
|
||||
CREATE TABLE t1(fld1 CHAR(10), FULLTEXT(fld1), FULLTEXT(fld1)) ENGINE= INNODB;
|
||||
Warnings:
|
||||
Note 1831 Duplicate index `fld1_2`. This is deprecated and will be disallowed in a future release
|
||||
INSERT INTO t1 VALUES("String1");
|
||||
#OPTIMIZE TABLE operation.
|
||||
OPTIMIZE TABLE t1;
|
||||
connection con1;
|
||||
SET DEBUG_SYNC= 'now WAIT_FOR upgraded';
|
||||
INSERT INTO t1 VALUES("String2");
|
||||
connection default;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
|
||||
test.t1 optimize status OK
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
affected rows: 1
|
||||
info: Records: 1 Duplicates: 0 Warnings: 0
|
||||
DROP TABLE t1;
|
||||
#Test which demonstrates that ALTER TABLE, OPTIMIZE PARTITION
|
||||
#takes OPTIMIZE TABLE code path, hence does an online rebuild
|
||||
|
Reference in New Issue
Block a user