summaryrefslogtreecommitdiff
path: root/storage/innobase/dict
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-05-19 12:33:47 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-05-19 16:02:13 +0300
commitcb437417d2214474102a11f0a207bb3bc86252ee (patch)
tree5beda3be862f41f2c56ba0e21e0df9e4851cfada /storage/innobase/dict
parentf9144a42e7ee006319eff7470da403589f155027 (diff)
downloadmariadb-git-cb437417d2214474102a11f0a207bb3bc86252ee.tar.gz
MDEV-19114 gcol.innodb_virtual_debug: Assertion n_fields>0 failed
This is a regression due to MDEV-16376 commit 8dc70c862b8ec115fd9a3c2b37c746ffc4f0d3cc. To make dict_index_t::detach_columns() idempotent, we cleared dict_index_t::n_fields. But, this could cause trouble with purge after a secondary index creation failed (not even involving virtual columns). A better way is to clear the dict_field_t::col pointers that point to virtual columns that are being freed due to aborting index creation on an index that depends on a virtual column. Note: the v_cols[] of an existing dict_table_t object will never be modified. If any virtual columns are added or removed, ha_innobase::commit_inplace_alter_table() would invoke dict_table_remove_from_cache() and reload the table to dict_sys. Index creation is a special case where the dict_index_t points to virtual columns that do not yet exist in dict_table_t.
Diffstat (limited to 'storage/innobase/dict')
-rw-r--r--storage/innobase/dict/dict0dict.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc
index cff213dea3d..3dfbe92e34c 100644
--- a/storage/innobase/dict/dict0dict.cc
+++ b/storage/innobase/dict/dict0dict.cc
@@ -2200,7 +2200,7 @@ dict_index_remove_from_v_col_list(dict_index_t* index) {
for (ulint i = 0; i < dict_index_get_n_fields(index); i++) {
col = dict_index_get_nth_col(index, i);
- if (dict_col_is_virtual(col)) {
+ if (col && col->is_virtual()) {
vcol = reinterpret_cast<const dict_v_col_t*>(
col);
/* This could be NULL, when we do add