Skip to content

Commit

Permalink
MDEV-22871 follow-up fix: AHI corruption & leak
Browse files Browse the repository at this point in the history
Commit bf3c862
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.
  • Loading branch information
dr-m committed Jun 19, 2020
1 parent 4243785 commit e341fb0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion storage/innobase/btr/btr0sea.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 4 additions & 0 deletions storage/innobase/include/btr0sea.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
};

Expand Down

0 comments on commit e341fb0

Please sign in to comment.