Commit 7b72fc0a authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-22739 !cursor->index->is_committed() in row0ins.cc

row_ins_sec_index_entry_by_modify(): When noticing a corrupted secondary
index on which CREATE INDEX is not in progress, return DB_CORRUPTION
instead of intentionally crashing the server.

Tested by: Matthias Leich
parent e38c075a
...@@ -214,14 +214,14 @@ row_ins_sec_index_entry_by_modify( ...@@ -214,14 +214,14 @@ row_ins_sec_index_entry_by_modify(
made to the clustered index, and completed the made to the clustered index, and completed the
secondary index creation before we got here. In this secondary index creation before we got here. In this
case, the change would already be there. The CREATE case, the change would already be there. The CREATE
INDEX should be waiting for a MySQL meta-data lock INDEX should be in wait_while_table_is_used() at least
upgrade at least until this INSERT or UPDATE until this INSERT or UPDATE returns. After that point,
returns. After that point, set_committed(true) set_committed(true) would be invoked in
would be invoked in commit_inplace_alter_table(). */ commit_inplace_alter_table(). */
ut_a(update->n_fields == 0); ut_a(update->n_fields == 0);
ut_a(!cursor->index()->is_committed());
ut_ad(!dict_index_is_online_ddl(cursor->index())); ut_ad(!dict_index_is_online_ddl(cursor->index()));
return(DB_SUCCESS); return cursor->index()->is_committed()
? DB_CORRUPTION : DB_SUCCESS;
} }
if (mode == BTR_MODIFY_LEAF) { if (mode == BTR_MODIFY_LEAF) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment