1
0
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:
Monty
2024-03-12 13:54:30 +02:00
committed by Sergei Golubchik
parent 6254fcf84a
commit 2464ee758a
58 changed files with 1171 additions and 2205 deletions

View File

@ -611,27 +611,8 @@ INSERT INTO t1 VALUES(10, 20);
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 alter_algorithm enabled.
SET SESSION alter_algorithm= TRUE;
ALTER TABLE t1 FORCE;
ALTER TABLE t1 ENGINE= INNODB;
SET DEBUG_SYNC= 'alter_table_copy_after_lock_upgrade SIGNAL upgraded';
--echo #OPTIMIZE TABLE operation using table copy.
--send OPTIMIZE TABLE t1
--connection con1
SET DEBUG_SYNC= 'now WAIT_FOR upgraded';
INSERT INTO t1 VALUES(10, 20);
--connection default
--reap
SET DEBUG_SYNC= 'RESET';
SET SESSION alter_algorithm= FALSE;
--echo #ALTER TABLE FORCE and ALTER TABLE ENGINE uses table copy
--echo #when ALGORITHM COPY is used.
--echo # ALTER TABLE FORCE and ALTER TABLE ENGINE uses table copy
--echo # when ALGORITHM COPY is used.
ALTER TABLE t1 FORCE, ALGORITHM= COPY;
ALTER TABLE t1 ENGINE= INNODB, ALGORITHM= COPY;
--disable_info
@ -639,29 +620,6 @@ ALTER TABLE t1 ENGINE= INNODB, ALGORITHM= COPY;
#cleanup
DROP TABLE t1;
--echo #OPTIMIZE TABLE on a table with FULLTEXT index uses
--echo #ALTER TABLE FORCE using COPY algorithm here. This
--echo #test case ensures the COPY table debug sync point is hit.
SET DEBUG_SYNC= 'alter_table_copy_after_lock_upgrade SIGNAL upgraded';
--echo #Setup a table with FULLTEXT index.
--connection default
CREATE TABLE t1(fld1 CHAR(10), FULLTEXT(fld1), FULLTEXT(fld1)) ENGINE= INNODB;
INSERT INTO t1 VALUES("String1");
--echo #OPTIMIZE TABLE operation.
--send OPTIMIZE TABLE t1
--connection con1
SET DEBUG_SYNC= 'now WAIT_FOR upgraded';
INSERT INTO t1 VALUES("String2");
--connection default
--reap
SET DEBUG_SYNC= 'RESET';
DROP TABLE t1;
--echo #Test which demonstrates that ALTER TABLE, OPTIMIZE PARTITION
--echo #takes OPTIMIZE TABLE code path, hence does an online rebuild
--echo #of the table with the patch.