diff options
author | unknown <svoj@april.(none)> | 2006-04-19 15:13:50 +0500 |
---|---|---|
committer | unknown <svoj@april.(none)> | 2006-04-19 15:13:50 +0500 |
commit | 4441e34e38acc430a229844a85756891221068a4 (patch) | |
tree | 5bb95b29ccad280aca995617952fa4dd8c747dc3 /myisam | |
parent | 8077c693a60bc9b5d0d0fee19712e9dcda5cc5ff (diff) | |
download | mariadb-git-4441e34e38acc430a229844a85756891221068a4.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.
heap/hp_delete.c:
Added size of the key to tree_delete() for accurate allocated memory counter.
include/my_tree.h:
Added size of the key to tree_delete() for accurate allocated memory counter.
myisam/myisamlog.c:
Added size of the key to tree_delete() for accurate allocated memory counter.
mysql-test/r/heap_btree.result:
Testcase for BUG#18160.
mysql-test/t/heap_btree.test:
Testcase for BUG#18160.
mysys/tree.c:
Added size of the key to tree_delete() for accurate allocated memory counter.
Note that this size is optional. If one doesn't need precise counter it is safe
to pass 0 as key_size.
Diffstat (limited to 'myisam')
-rw-r--r-- | myisam/myisamlog.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/myisam/myisamlog.c b/myisam/myisamlog.c index de55b86252c..17af4ab34a2 100644 --- a/myisam/myisamlog.c +++ b/myisam/myisamlog.c @@ -475,7 +475,7 @@ static int examine_log(my_string file_name, char **table_names) { if (!curr_file_info->closed) files_open--; - VOID(tree_delete(&tree, (gptr) curr_file_info, tree.custom_arg)); + VOID(tree_delete(&tree, (gptr) curr_file_info, 0, tree.custom_arg)); } break; case MI_LOG_EXTRA: |