diff options
author | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2020-09-08 17:24:08 +0530 |
---|---|---|
committer | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2020-09-25 21:42:24 +0530 |
commit | e8b05ce503dffc2d95d1583b7c89403d320e263c (patch) | |
tree | 6da1d95dd009f76bd82c058366f62c8ac6ed0747 /storage/innobase/row | |
parent | 6a1376252d7997f6fa1268c08bed5f93b32922f8 (diff) | |
download | mariadb-git-e8b05ce503dffc2d95d1583b7c89403d320e263c.tar.gz |
MDEV-23675 Assertion `pos < table->n_def' fails in dict_table_get_nth_col
- During insertion of clustered inde, InnoDB does the check for
foreign key constraints. It rebuild the tuple based on foreign
column names when there is no foreign index. While rebuilding,
InnoDB should ignore the dropped columns.
Diffstat (limited to 'storage/innobase/row')
-rw-r--r-- | storage/innobase/row/row0ins.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc index 9c913b0c9f2..a28489062b0 100644 --- a/storage/innobase/row/row0ins.cc +++ b/storage/innobase/row/row0ins.cc @@ -1908,8 +1908,14 @@ bool row_ins_foreign_index_entry(dict_foreign_t *foreign, { for (ulint j= 0; j < index->n_fields; j++) { - const char *col_name= dict_table_get_col_name( - index->table, dict_index_get_nth_col_no(index, j)); + const dict_col_t *col= dict_index_get_nth_col(index, j); + + /* A clustered index may contain instantly dropped columns, + which must be skipped. */ + if (col->is_dropped()) + continue; + + const char *col_name= dict_table_get_col_name(index->table, col->ind); if (0 == innobase_strcasecmp(col_name, foreign->foreign_col_names[i])) { dfield_copy(&ref_entry->fields[i], &entry->fields[j]); |