1
0
mirror of https://github.com/MariaDB/server.git synced 2025-04-28 06:45:23 +03:00

2 Commits

Author SHA1 Message Date
Nikita Malyavin
9a645dae9e MDEV-23632 ALTER TABLE...ADD KEY creates corrupted index on virtual column
mysql_col_offset was not updated after the new column has been added by an
INSTANT ALTER TABLE -- table data dictionary had been remaining the same.

When the virtual column is added or removed, table was usually evicted and
then reopened, which triggered vcol info rebuild on the next open.

However this also should be done when the usual column is added or removed:
mariadb always stores virtual field at the end of maria record,
so the shift should always happen.

Fix:
expand the eviction condition to the case when usual fields are
added/removed

Note:
this should happen only in the case of !new_clustered:
* When new_clustered is true, a new data dictionary is created, and vcol
metadata is rebuilt in `alter_rebuild_apply_log()`
* We can't do it in `new_clustered` case, because the old table is not yet
subctituted correctly
2021-01-05 19:19:27 +10:00
Jan Lindström
96987cb4e9 Added tests for MDEV-11724, MDEV-11725, MDEV-11726. 2017-05-09 19:44:10 +02:00