diff options
author | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2021-04-08 16:37:18 +0530 |
---|---|---|
committer | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2021-04-08 16:41:14 +0530 |
commit | e1781655a6901fa9eeb26a82d8b1576492fb7587 (patch) | |
tree | cac6d72e1436628ad5fe99a1bc53715f5625340b /libmysqld | |
parent | 7c524d4414e1608a54a8affbcce35d08c1ceaa59 (diff) | |
download | mariadb-git-bb-10.6-MDEV-24971.tar.gz |
MDEV-24971 InnoDB access freed virtual column after rollback of secondary indexbb-10.6-MDEV-24971
Problem:
========
InnoDB fails to clean the index stub if it fails to add the virtual index
which contains new virtual column. But it clears the newly virtual column
from index in clear_added_indexes() during inplace_alter_table.
InnoDB clears the ABORTED index while opening the table or doing the DDL.
In the mean time, InnoDB can access the dropped virtual index columns
while creating prebuilt or rollback of concurrent DML.
Solution:
==========
(1) InnoDB should maintain newly added virtual column while rollbacking the
newly added virtual index.
(2) InnoDB should avoid the defer of index removal
if the alter table is executed with LOCK=EXCLUSIVE.
(3) InnoDB should check whether the table has any other transaction lock
other than alter transaction before deferring the index stub.
Replaced has_new_v_col with dict_add_vcol_info in dict_index_t to
indicate whether the index has any new virtual column.
dict_index_t::has_new_v_col(): Returns whether the index has newly
added virtual column
ha_innobase_inplace_ctx::is_new_vcol(): Return whether the given
column is added as a part of the current alter.
ha_innobase_inplace_ctx::clean_new_vcol_index(): Copy the newly
added virtual column to new_vcol_info in dict_index_t. Replace
the column in the index fields with virtual column stored
in new_vcol_info.
dict_index_t::assign_new_v_col(): Store the number of virtual
column added in index as a part of alter table.
dict_index_t::get_n_new_vcol(): Get the number of newly added virtual
column
dict_index_t::assign_drop_v_col(): Allocate the memory for adding new
virtual column in new_vcol_info.
dict_index_t::add_drop_v_col(): Add the newly added virtual column
in new_vcol_info.
dict_table_t::has_lock_for_other_trx(): Whether the table has any other
transaction lock than given transaction.
row_merge_drop_indexes(): Add parameter alter_trx and check whether the
table has any other lock than alter transaction.
Diffstat (limited to 'libmysqld')
0 files changed, 0 insertions, 0 deletions