diff options
author | unknown <bar@gw.udmsearch.izhnet.ru> | 2002-04-17 17:27:13 +0500 |
---|---|---|
committer | unknown <bar@gw.udmsearch.izhnet.ru> | 2002-04-17 17:27:13 +0500 |
commit | 48297dbfcf6c3829b21662774cdc08e65dede423 (patch) | |
tree | 92e6fc45572614370bd232fe2f4004d912ac6fc8 /heap/hp_hash.c | |
parent | 804af496a1e5504fc0f5883b5dfb7502dcc0dbb4 (diff) | |
download | mariadb-git-48297dbfcf6c3829b21662774cdc08e65dede423.tar.gz |
Fix for problem that GROUP BY and DISTINCT didn't work for UTF8
Diffstat (limited to 'heap/hp_hash.c')
-rw-r--r-- | heap/hp_hash.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/heap/hp_hash.c b/heap/hp_hash.c index 519779d330d..2ca33e5b782 100644 --- a/heap/hp_hash.c +++ b/heap/hp_hash.c @@ -151,7 +151,8 @@ void _hp_movelink(HASH_INFO *pos, HASH_INFO *next_link, HASH_INFO *newlink) ulong _hp_hashnr(register HP_KEYDEF *keydef, register const byte *key) { - register ulong nr=1, nr2=4; + /*register*/ + ulong nr=1, nr2=4; HP_KEYSEG *seg,*endseg; for (seg=keydef->seg,endseg=seg+keydef->keysegs ; seg < endseg ; seg++) @@ -170,6 +171,10 @@ ulong _hp_hashnr(register HP_KEYDEF *keydef, register const byte *key) } if (seg->type == HA_KEYTYPE_TEXT) { + if (default_charset_info->hash_sort) + default_charset_info->hash_sort(default_charset_info, + pos,((uchar*)key)-pos,&nr,&nr2); + else for (; pos < (uchar*) key ; pos++) { nr^=(ulong) ((((uint) nr & 63)+nr2) * @@ -193,7 +198,8 @@ ulong _hp_hashnr(register HP_KEYDEF *keydef, register const byte *key) ulong _hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec) { - register ulong nr=1, nr2=4; + /*register*/ + ulong nr=1, nr2=4; HP_KEYSEG *seg,*endseg; for (seg=keydef->seg,endseg=seg+keydef->keysegs ; seg < endseg ; seg++) @@ -209,6 +215,10 @@ ulong _hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec) } if (seg->type == HA_KEYTYPE_TEXT) { + if (default_charset_info->hash_sort) + default_charset_info->hash_sort(default_charset_info, + pos,end-pos,&nr,&nr2); + else for (; pos < end ; pos++) { nr^=(ulong) ((((uint) nr & 63)+nr2)* |