summaryrefslogtreecommitdiff
path: root/heap
diff options
context:
space:
mode:
authorsvoj@april.(none) <>2006-04-19 15:13:50 +0500
committersvoj@april.(none) <>2006-04-19 15:13:50 +0500
commit06ce215f103cf83aee63a9e24340e15ee8ca1ee8 (patch)
tree5bb95b29ccad280aca995617952fa4dd8c747dc3 /heap
parentda6210ee61ed204d1b327081d5258f13eec5072d (diff)
downloadmariadb-git-06ce215f103cf83aee63a9e24340e15ee8ca1ee8.tar.gz
BUG#18160 - Memory-/HEAP Table endless growing indexes
Updating data in HEAP table with BTREE index results in wrong index_length counter value, which keeps growing after each update. When inserting new record into tree counter is incremented by: sizeof(TREE_ELEMENT) + key_size + tree->size_of_element But when deleting element from tree it doesn't decrement counter by key_size: sizeof(TREE_ELEMENT) + tree->size_of_element This fix makes accurate allocated memory counter for tree. That is decrease counter by key_size when deleting tree element.
Diffstat (limited to 'heap')
-rw-r--r--heap/hp_delete.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/heap/hp_delete.c b/heap/hp_delete.c
index 2d94418a1bf..f37db2588f3 100644
--- a/heap/hp_delete.c
+++ b/heap/hp_delete.c
@@ -79,7 +79,8 @@ int hp_rb_delete_key(HP_INFO *info, register HP_KEYDEF *keyinfo,
custom_arg.key_length= hp_rb_make_key(keyinfo, info->recbuf, record, recpos);
custom_arg.search_flag= SEARCH_SAME;
old_allocated= keyinfo->rb_tree.allocated;
- res= tree_delete(&keyinfo->rb_tree, info->recbuf, &custom_arg);
+ res= tree_delete(&keyinfo->rb_tree, info->recbuf, custom_arg.key_length,
+ &custom_arg);
info->s->index_length-= (old_allocated - keyinfo->rb_tree.allocated);
return res;
}