summaryrefslogtreecommitdiff
path: root/heap/hp_write.c
diff options
context:
space:
mode:
authorvva@eagle.mysql.r18.ru <>2004-02-20 00:33:16 +0400
committervva@eagle.mysql.r18.ru <>2004-02-20 00:33:16 +0400
commit38a72a162a29029ea2af78ae112d98ce59209a12 (patch)
treee41acd79f185b6c97daf918fc209e42d084943be /heap/hp_write.c
parent00e2668b877353c21d2018c989e06427aa41672d (diff)
downloadmariadb-git-38a72a162a29029ea2af78ae112d98ce59209a12.tar.gz
fixed for BUG #2719 "Heap tables status shows wrong or missing data"
Diffstat (limited to 'heap/hp_write.c')
-rw-r--r--heap/hp_write.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/heap/hp_write.c b/heap/hp_write.c
index f92d8caa633..3b0ec76d616 100644
--- a/heap/hp_write.c
+++ b/heap/hp_write.c
@@ -99,6 +99,7 @@ int hp_rb_write_key(HP_INFO *info, HP_KEYDEF *keyinfo, const byte *record,
byte *recpos)
{
heap_rb_param custom_arg;
+ uint old_allocated;
info->last_pos= NULL; /* For heap_rnext/heap_rprev */
custom_arg.keyseg= keyinfo->seg;
@@ -113,12 +114,14 @@ int hp_rb_write_key(HP_INFO *info, HP_KEYDEF *keyinfo, const byte *record,
custom_arg.search_flag= SEARCH_SAME;
keyinfo->rb_tree.flag= 0;
}
+ old_allocated= keyinfo->rb_tree.allocated;
if (!tree_insert(&keyinfo->rb_tree, (void*)info->recbuf,
custom_arg.key_length, &custom_arg))
{
my_errno= HA_ERR_FOUND_DUPP_KEY;
return 1;
}
+ info->s->index_length+= (keyinfo->rb_tree.allocated-old_allocated);
return 0;
}