mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
MDEV-13818 CREATE INDEX leaks memory if running out of undo log space
if create_index_dict() fails, we need to free ctx->add_index[a] too This fixes innodb.alter_crash and innodb.instant_alter_debug failures in ASAN_OPTIONS="abort_on_error=1" runs
This commit is contained in:
@@ -5634,18 +5634,19 @@ new_table_failed:
|
||||
ctx->trx->table_id = user_table->id;
|
||||
|
||||
for (ulint a = 0; a < ctx->num_to_add_index; a++) {
|
||||
dict_index_t*& index = ctx->add_index[a];
|
||||
dict_index_t* index = ctx->add_index[a];
|
||||
const bool has_new_v_col = index->has_new_v_col;
|
||||
index = create_index_dict(ctx->trx, index, add_v);
|
||||
if (!index) {
|
||||
error = ctx->trx->error_state;
|
||||
ut_ad(error != DB_SUCCESS);
|
||||
error_handling_drop_uncached:
|
||||
while (++a < ctx->num_to_add_index) {
|
||||
do {
|
||||
dict_mem_index_free(ctx->add_index[a]);
|
||||
}
|
||||
} while (++a < ctx->num_to_add_index);
|
||||
goto error_handling;
|
||||
}
|
||||
ctx->add_index[a]= index;
|
||||
|
||||
index->parser = index_defs[a].parser;
|
||||
index->has_new_v_col = has_new_v_col;
|
||||
|
||||
Reference in New Issue
Block a user