mirror of
https://github.com/MariaDB/server.git
synced 2026-05-05 14:45:31 +02:00
Fixed --no-defaults in mysqltest
BUILD/compile-pentium-debug: Use /usr/local/BerkeleyDB-dbug/ if available BUILD/compile-pentium: Use /usr/local/BerkeleyDB-opt/ if available Docs/internals.texi: Added 'unedited' documentation for mysys functions Docs/manual.texi: Cleanups client/mysql.cc: Added client language to status client/mysqltest.c: Fixed bug with --no-defaults heap/_check.c: Added option to print status. heap/hp_close.c: Update to use new status interface heap/hp_hash.c: Clean up hash function and add new experimental hash heap/hp_test1.c: Update to use new status interface heap/hp_test2.c: Update to use new status interface include/heap.h: Update to use new status interface mysql-test/r/key_diff.result: Cleanup tests that may give rows in random order mysql-test/r/type_blob.result: Removed \r from output as this confused bk mysql-test/t/key_diff.test: Cleanup tests that may give rows in random order BitKeeper/etc/ignore: Added Docs/my_sys.doc to the ignore list mysql-test/t/type_blob.test: Removed \r from output as this confused bk mysys/hash.c: Add new experimental hash function scripts/safe_mysqld.sh: Added --mysqld option sql/ha_innobase.cc: Fixed store_locking sql/mysqld.cc: Cleaned up warning messages
This commit is contained in:
parent
ccf4b28298
commit
29fa72526a
22 changed files with 384 additions and 66 deletions
45
mysys/hash.c
45
mysys/hash.c
|
|
@ -108,6 +108,8 @@ static uint hash_rec_mask(HASH *hash,HASH_LINK *pos,uint buffmax,
|
|||
return hash_mask((*hash->calc_hashnr)(key,length),buffmax,maxlength);
|
||||
}
|
||||
|
||||
#ifndef NEW_HASH_FUNCTION
|
||||
|
||||
/* Calc hashvalue for a key */
|
||||
|
||||
static uint calc_hashnr(const byte *key,uint length)
|
||||
|
|
@ -134,6 +136,49 @@ static uint calc_hashnr_caseup(const byte *key,uint length)
|
|||
return((uint) nr);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
/*
|
||||
* Fowler/Noll/Vo hash
|
||||
*
|
||||
* The basis of the hash algorithm was taken from an idea sent by email to the
|
||||
* IEEE Posix P1003.2 mailing list from Phong Vo (kpv@research.att.com) and
|
||||
* Glenn Fowler (gsf@research.att.com). Landon Curt Noll (chongo@toad.com)
|
||||
* later improved on their algorithm.
|
||||
*
|
||||
* The magic is in the interesting relationship between the special prime
|
||||
* 16777619 (2^24 + 403) and 2^32 and 2^8.
|
||||
*
|
||||
* This hash produces the fewest collisions of any function that we've seen so
|
||||
* far, and works well on both numbers and strings.
|
||||
*/
|
||||
|
||||
uint calc_hashnr(const byte *key, uint len)
|
||||
{
|
||||
const byte *end=key+len;
|
||||
uint hash;
|
||||
for (hash = 0; key < end; key++)
|
||||
{
|
||||
hash *= 16777619;
|
||||
hash ^= (uint) *(uchar*) key;
|
||||
}
|
||||
return (hash);
|
||||
}
|
||||
|
||||
uint calc_hashnr_caseup(const byte *key, uint len)
|
||||
{
|
||||
const byte *end=key+len;
|
||||
uint hash;
|
||||
for (hash = 0; key < end; key++)
|
||||
{
|
||||
hash *= 16777619;
|
||||
hash ^= (uint) (uchar) toupper(*key);
|
||||
}
|
||||
return (hash);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
static inline uint rec_hashnr(HASH *hash,const byte *record)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue