Commit 455a15fd authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-33972: Memory corruption in innodb.insert_into_empty

trx_t::bulk_insert_apply_for_table(dict_table_t *table):
Do not write through an invalid iterator.
This fixes up commit 863f5996 (MDEV-33868).
parent f0d0ddc9
...@@ -5374,13 +5374,15 @@ dberr_t trx_t::bulk_insert_apply_for_table(dict_table_t *table) ...@@ -5374,13 +5374,15 @@ dberr_t trx_t::bulk_insert_apply_for_table(dict_table_t *table)
if (UNIV_UNLIKELY(!bulk_insert)) if (UNIV_UNLIKELY(!bulk_insert))
return DB_SUCCESS; return DB_SUCCESS;
auto it= mod_tables.find(table); auto it= mod_tables.find(table);
if (it != mod_tables.end() && it->second.bulk_store) if (it != mod_tables.end())
{
if (dberr_t err= it->second.write_bulk(table, this)) if (dberr_t err= it->second.write_bulk(table, this))
{ {
bulk_rollback_low(); bulk_rollback_low();
return err; return err;
} }
it->second.end_bulk_insert(); it->second.end_bulk_insert();
}
return DB_SUCCESS; return DB_SUCCESS;
} }
......
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