Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.4.31
-
None
Description
create table test (t text, unique index i(t)); |
ALTER TABLE test ADD COLUMN test INT NULL AFTER t; |
ERROR 1846 (0A000): ALGORITHM=INSTANT is not supported. Reason: INPLACE ADD or DROP of virtual columns cannot be combined with other ALTER TABLE actions. Try ALGORITHM=COPY |
While the unique index i doesn't take place in the later, it does prevent it from instantly happening.
Early in the alter_table processing compare_keys_but_name compares the existing table key and the table keys in the new structure, and determines they are different.
This is because:
- the table_key got treated by re_setup_keyinfo_hash and had HA_NOSAME stripped from the table_key->flags.
- comparing further down in the same function, the comparsion of parts fails as the new_part->field and fields aren't populated.
This results in the ALTER TABLE considering the index to be different, and not allowing the ALGORITHM=INSTANT later.
Attachments
Issue Links
- is caused by
-
MDEV-371 Unique indexes for blobs
- Closed
- is duplicated by
-
MDEV-17468 Avoid table rebuild on operations on generated columns
- Stalled
- relates to
-
MDEV-11369 Instant add column for InnoDB
- Closed
-
MDEV-14341 Allow LOCK=NONE in table-rebuilding ALTER when indexed virtual columns exist
- Open
-
MDEV-15562 Instant DROP COLUMN or changing the order of columns
- Closed
-
MDEV-18790 Server crash in fields_in_hash_keyinfo after unsuccessful attempt to drop BLOB with long index
- Closed
-
MDEV-20918 INSTANT algorithm doesn't work with unique HASH index
- Open
- links to