mirror of
https://github.com/MariaDB/server.git
synced 2025-06-15 09:14:39 +02:00

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.
40 lines
1.2 KiB
Text
40 lines
1.2 KiB
Text
--source include/have_partition.inc
|
|
--source include/have_innodb.inc
|
|
--source include/have_innodb_16k.inc
|
|
|
|
# MDEV-21832 FORCE all partition to rebuild if any one of the
|
|
# partition does rebuild
|
|
CREATE TABLE t1 (
|
|
id INT NOT NULL,
|
|
name VARCHAR(30))ENGINE=InnoDB ROW_FORMAT=COMPACT CHARACTER SET=latin1
|
|
PARTITION BY RANGE (id) (
|
|
PARTITION p0 VALUES LESS THAN (50),
|
|
PARTITION p1 VALUES LESS THAN (MAXVALUE)
|
|
);
|
|
|
|
INSERT INTO t1(id, name) VALUES(16, 'Me'), (337, 'ROFL');
|
|
|
|
--echo # Add and drop 31 Instant columns
|
|
--disable_query_log
|
|
let $i = 1;
|
|
while ($i < 32) {
|
|
--eval ALTER TABLE t1 ADD COLUMN col$i VARCHAR(255) NOT NULL DEFAULT repeat('a', 255);
|
|
inc $i;
|
|
}
|
|
|
|
let $i = 31;
|
|
while ($i > 0) {
|
|
--eval ALTER TABLE t1 DROP COLUMN col$i
|
|
dec $i;
|
|
}
|
|
--enable_query_log
|
|
|
|
CREATE TABLE t2 LIKE t1;
|
|
SHOW CREATE TABLE t2;
|
|
ALTER TABLE t2 REMOVE PARTITIONING;
|
|
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
|
|
SHOW CREATE TABLE t2;
|
|
--error ER_ALTER_OPERATION_NOT_SUPPORTED
|
|
ALTER TABLE t1 ADD COLUMN col1 VARCHAR(255) NOT NULL DEFAULT repeat('a', 255), ALGORITHM=INSTANT;
|
|
ALTER TABLE t1 ADD COLUMN col1 VARCHAR(255) NOT NULL DEFAULT repeat('a', 255), ALGORITHM=INPLACE;
|
|
DROP TABLE t1, t2;
|