summaryrefslogtreecommitdiff
path: root/heap/hp_hash.c
diff options
context:
space:
mode:
authorsergefp@mysql.com <>2004-09-08 02:07:53 +0400
committersergefp@mysql.com <>2004-09-08 02:07:53 +0400
commit2c9d2cf671d33f598dcec7eb5604f98638c96490 (patch)
tree5fb9bac74cdad46fce2efb3c783f9a02367489bd /heap/hp_hash.c
parent15eb33ab44b6af9f34e65d941739fadcd0026866 (diff)
downloadmariadb-git-2c9d2cf671d33f598dcec7eb5604f98638c96490.tar.gz
Fix for bug#5138: hash indexes on heap tables support statistics.
KEY::rec_per_key is updated every time 1/HEAP_STATS_UPDATE_THRESHOLD part of table records has been changed.
Diffstat (limited to 'heap/hp_hash.c')
-rw-r--r--heap/hp_hash.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/heap/hp_hash.c b/heap/hp_hash.c
index 71eecc8bdf2..2108765cc7f 100644
--- a/heap/hp_hash.c
+++ b/heap/hp_hash.c
@@ -196,7 +196,18 @@ byte *hp_search_next(HP_INFO *info, HP_KEYDEF *keyinfo, const byte *key,
}
- /* Calculate pos according to keys */
+/*
+ Calculate position number for hash value.
+ SYNOPSIS
+ hp_mask()
+ hashnr Hash value
+ buffmax Value such that
+ 2^(n-1) < maxlength <= 2^n = buffmax
+ maxlength
+
+ RETURN
+ Array index, in [0..maxlength)
+*/
ulong hp_mask(ulong hashnr, ulong buffmax, ulong maxlength)
{
@@ -205,7 +216,12 @@ ulong hp_mask(ulong hashnr, ulong buffmax, ulong maxlength)
}
- /* Change link from pos to new_link */
+/*
+ Change
+ next_link -> ... -> X -> pos
+ to
+ next_link -> ... -> X -> newlink
+*/
void hp_movelink(HASH_INFO *pos, HASH_INFO *next_link, HASH_INFO *newlink)
{