summaryrefslogtreecommitdiff
path: root/storage/xtradb/dict
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-05-09 15:06:48 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2018-05-09 15:56:26 +0300
commit4f42f0d1eafd82adef513a1064ff44b50063db7e (patch)
tree5a70215a7a5203038af00ac952b50258a65af33d /storage/xtradb/dict
parent34045af03f25fc2edd7c0c8db054e505f271513c (diff)
downloadmariadb-git-4f42f0d1eafd82adef513a1064ff44b50063db7e.tar.gz
MDEV-16119 InnoDB lock->index refers to a freed object after failed ADD INDEX
The problem is hard to repeat, and I failed to create a deterministic test case. Online index creation creates stubs for to-be-created indexes. If index creation fails, we could remove these stubs while locks exist in the indexes. (This would require that the index creation was completed, and a concurrent DML operation acquired a lock on a record in the uncommitted index. If a duplicate key error occurs in an uncommitted index, the error will be reported for the CREATE UNIQUE INDEX, not for the DML operation that tried to insert the duplicate.) dict_table_try_drop_aborted(), row_merge_drop_indexes(): If transactional locks exist on the table, keep the table->indexes intact.
Diffstat (limited to 'storage/xtradb/dict')
-rw-r--r--storage/xtradb/dict/dict0dict.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/storage/xtradb/dict/dict0dict.cc b/storage/xtradb/dict/dict0dict.cc
index e2aefc909f8..b76414eeea4 100644
--- a/storage/xtradb/dict/dict0dict.cc
+++ b/storage/xtradb/dict/dict0dict.cc
@@ -507,7 +507,8 @@ dict_table_try_drop_aborted(
ut_ad(table->id == table_id);
}
- if (table && table->n_ref_count == ref_count && table->drop_aborted) {
+ if (table && table->n_ref_count == ref_count && table->drop_aborted
+ && !UT_LIST_GET_FIRST(table->locks)) {
/* Silence a debug assertion in row_merge_drop_indexes(). */
ut_d(table->n_ref_count++);
row_merge_drop_indexes(trx, table, TRUE);