mirror of
https://github.com/MariaDB/server.git
synced 2025-01-30 18:41:56 +01:00
62 lines
1.9 KiB
Text
62 lines
1.9 KiB
Text
--source include/innodb_page_size.inc
|
|
|
|
SET @old_instant=
|
|
(SELECT variable_value FROM information_schema.global_status
|
|
WHERE variable_name = 'innodb_instant_alter_column');
|
|
|
|
CREATE TABLE t(a INT PRIMARY KEY, b INT, c INT, d INT, e INT)
|
|
ENGINE=InnoDB;
|
|
INSERT INTO t VALUES(1,2,3,4,5);
|
|
SET innodb_strict_mode = OFF;
|
|
--disable_query_log
|
|
call mtr.add_suppression("\\[Warning\\] InnoDB: Cannot add .* in table `test`\\.`t` because after adding it, the row size");
|
|
let $n=253;
|
|
while ($n) {
|
|
dec $n;
|
|
ALTER TABLE t DROP b, DROP c, DROP d, DROP e,
|
|
ADD COLUMN b INT FIRST, ADD COLUMN c INT, ADD COLUMN d INT AFTER b,
|
|
ADD COLUMN e INT AFTER c, ALGORITHM=INSTANT;
|
|
}
|
|
--enable_query_log
|
|
SELECT * FROM t;
|
|
--error ER_ALTER_OPERATION_NOT_SUPPORTED
|
|
ALTER TABLE t DROP b, DROP c, DROP d, DROP e,
|
|
ADD COLUMN b INT, ALGORITHM=INSTANT;
|
|
ALTER TABLE t CHANGE COLUMN b beta INT AFTER a, ALGORITHM=INSTANT;
|
|
ALTER TABLE t DROP e, DROP c, DROP d, ALGORITHM=INSTANT;
|
|
SELECT * FROM t;
|
|
ALTER TABLE t DROP COLUMN beta, ALGORITHM=INSTANT;
|
|
--error ER_ALTER_OPERATION_NOT_SUPPORTED
|
|
ALTER TABLE t ADD COLUMN b INT NOT NULL, ALGORITHM=INSTANT;
|
|
|
|
SELECT variable_value-@old_instant instants
|
|
FROM information_schema.global_status
|
|
WHERE variable_name = 'innodb_instant_alter_column';
|
|
|
|
ALTER TABLE t ADD COLUMN b INT NOT NULL;
|
|
|
|
SELECT variable_value-@old_instant instants
|
|
FROM information_schema.global_status
|
|
WHERE variable_name = 'innodb_instant_alter_column';
|
|
|
|
SELECT * FROM t;
|
|
ALTER TABLE t ADD COLUMN (c CHAR(255) NOT NULL, d BIGINT NOT NULL),
|
|
ALGORITHM=INSTANT;
|
|
|
|
--disable_query_log
|
|
let $n=253;
|
|
while ($n) {
|
|
dec $n;
|
|
ALTER TABLE t DROP b, DROP c, DROP d,
|
|
ADD COLUMN (b INT NOT NULL, c CHAR(255) NOT NULL, d BIGINT NOT NULL);
|
|
}
|
|
--enable_query_log
|
|
|
|
UPDATE t SET b=b+1,d=d+1,c='foo';
|
|
SELECT * FROM t;
|
|
|
|
SELECT variable_value-@old_instant instants
|
|
FROM information_schema.global_status
|
|
WHERE variable_name = 'innodb_instant_alter_column';
|
|
|
|
DROP TABLE t;
|