diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-06-19 12:30:25 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-06-19 12:34:21 +0300 |
commit | e341fb0dae1008b98d6fc96f8847e6f1bd975db3 (patch) | |
tree | bb6960d5c41bfd932c2d7a33fb4d3a94d425358f | |
parent | 4243785f288149fc1571b168cda1c921cfaf77a5 (diff) | |
download | mariadb-git-e341fb0dae1008b98d6fc96f8847e6f1bd975db3.tar.gz |
MDEV-22871 follow-up fix: AHI corruption & leak
Commit bf3c862faa8efed4a662725ec27586cd69e9228e
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.
-rw-r--r-- | storage/innobase/btr/btr0sea.cc | 2 | ||||
-rw-r--r-- | storage/innobase/include/btr0sea.h | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/storage/innobase/btr/btr0sea.cc b/storage/innobase/btr/btr0sea.cc index e65bef02f47..de2f58a23b4 100644 --- a/storage/innobase/btr/btr0sea.cc +++ b/storage/innobase/btr/btr0sea.cc @@ -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); } diff --git a/storage/innobase/include/btr0sea.h b/storage/innobase/include/btr0sea.h index e3de4926a57..f09920b1816 100644 --- a/storage/innobase/include/btr0sea.h +++ b/storage/innobase/include/btr0sea.h @@ -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; + } } }; |