Commit e341fb0d authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-22871 follow-up fix: AHI corruption & leak

Commit bf3c862f
accidentally introduced two bugs.

btr_search_update_hash_ref(): Pass the correct parameter part->heap.

btr_search_sys_t::free(): Free all memory.

Thanks to Michael Widenius and Thirunarayanan Balathandayuthapani
for pointing out these bugs.
parent 4243785f
......@@ -740,7 +740,7 @@ btr_search_update_hash_ref(
mem_heap_free(heap);
}
ha_insert_for_fold(&part->table, heap, fold, block, rec);
ha_insert_for_fold(&part->table, part->heap, fold, block, rec);
MONITOR_INC(MONITOR_ADAPTIVE_HASH_ROW_ADDED);
}
......
......@@ -338,8 +338,12 @@ struct btr_search_sys_t
void free()
{
if (parts)
{
for (ulong i= 0; i < btr_ahi_parts; ++i)
parts[i].free();
ut_free(parts);
parts= nullptr;
}
}
};
......
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