diff options
author | bar@gw.udmsearch.izhnet.ru <> | 2002-04-17 17:27:13 +0500 |
---|---|---|
committer | bar@gw.udmsearch.izhnet.ru <> | 2002-04-17 17:27:13 +0500 |
commit | 64943e08a1ab71eeea57bd7dbbe7757dd69fc73a (patch) | |
tree | 92e6fc45572614370bd232fe2f4004d912ac6fc8 /heap | |
parent | 6b49eb2afc0f6e64ea4bd2e13bdb0fd8f929e11e (diff) | |
download | mariadb-git-64943e08a1ab71eeea57bd7dbbe7757dd69fc73a.tar.gz |
Fix for problem that GROUP BY and DISTINCT didn't work for UTF8
Diffstat (limited to 'heap')
-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)* |