Details
-
Bug
-
Status: Stalled (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.3.7
Description
When MDEV-11369 implemented instant ADD COLUMN, it would refuse to do instant ADD together with ADD INDEX.
Adding an index to an instantly added column does not make much sense, because the index would be useless due to every row initially having the same value for the instantly added column.
However, it is meaningful to ADD COLUMN together with ADD INDEX on some old column. This will currently cause the table to be rebuilt:
--source include/have_innodb.inc
|
create table t1(a int) engine=innodb; |
alter table t1 add column b int, add index(a), algorithm=nocopy; |
alter table t1 add column c int, add index(c), algorithm=nocopy; |
drop table t1; |
The first ALTER TABLE should be fixed to allow ALGORITHM=NOCOPY, but the second one can in my opinion continue to rebuild the table with ALGORITHM=INPLACE.
Attachments
Issue Links
- relates to
-
MDEV-11369 Instant add column for InnoDB
- Closed
-
MDEV-13134 Introduce ALTER TABLE attributes ALGORITHM=NOCOPY and ALGORITHM=INSTANT
- Closed
-
MDEV-15250 UPSERT during ALTER-TABLE results in 'Duplicate entry' error for alter
- Closed
-
MDEV-34813 ALGORITHM=INSTANT does not work for partitioned tables on indexed column
- Confirmed