summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorjimw@mysql.com <>2005-06-09 18:02:04 -0700
committerjimw@mysql.com <>2005-06-09 18:02:04 -0700
commit3c425f1f65332a0cca57a09b22e3c7556912fcd6 (patch)
tree5f61fcfce09ff7f10ee3f044687e1b310220b9fa /mysys
parenta3e72ec85ae4f94b7dd179007d7dabeba15eb87e (diff)
parent24f14c93cf4c10f04994fd28a1aa0ddec03c7edc (diff)
downloadmariadb-git-3c425f1f65332a0cca57a09b22e3c7556912fcd6.tar.gz
Merge mysql.com:/home/jimw/my/mysql-4.1-10931
into mysql.com:/home/jimw/my/mysql-4.1-clean
Diffstat (limited to 'mysys')
-rw-r--r--mysys/hash.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/mysys/hash.c b/mysys/hash.c
index b829f19dfc8..ffebdf76144 100644
--- a/mysys/hash.c
+++ b/mysys/hash.c
@@ -262,7 +262,25 @@ static void movelink(HASH_LINK *array,uint find,uint next_link,uint newlink)
return;
}
- /* Compare a key in a record to a whole key. Return 0 if identical */
+/*
+ Compare a key in a record to a whole key. Return 0 if identical
+
+ SYNOPSIS
+ hashcmp()
+ hash hash table
+ pos position of hash record to use in comparison
+ key key for comparison
+ length length of key
+
+ NOTES:
+ If length is 0, comparison is done using the length of the
+ record being compared against.
+
+ RETURN
+ < 0 key of record < key
+ = 0 key of record == key
+ > 0 key of record > key
+ */
static int hashcmp(HASH *hash,HASH_LINK *pos,const byte *key,uint length)
{
@@ -270,7 +288,7 @@ static int hashcmp(HASH *hash,HASH_LINK *pos,const byte *key,uint length)
byte *rec_key= (byte*) hash_key(hash,pos->data,&rec_keylength,1);
return ((length && length != rec_keylength) ||
my_strnncoll(hash->charset, (uchar*) rec_key, rec_keylength,
- (uchar*) key, length));
+ (uchar*) key, rec_keylength));
}