Commit 7d9572c2 authored by unknown's avatar unknown

Use keyseg charset instead of default_charset_info

parent 234dc3a3
...@@ -213,14 +213,13 @@ ulong hp_hashnr(register HP_KEYDEF *keydef, register const byte *key) ...@@ -213,14 +213,13 @@ ulong hp_hashnr(register HP_KEYDEF *keydef, register const byte *key)
} }
if (seg->type == HA_KEYTYPE_TEXT) if (seg->type == HA_KEYTYPE_TEXT)
{ {
if (default_charset_info->hash_sort) if (seg->charset->hash_sort)
default_charset_info->hash_sort(default_charset_info, seg->charset->hash_sort(seg->charset,pos,((uchar*)key)-pos,&nr,&nr2);
pos,((uchar*)key)-pos,&nr,&nr2);
else else
for (; pos < (uchar*) key ; pos++) for (; pos < (uchar*) key ; pos++)
{ {
nr^=(ulong) ((((uint) nr & 63)+nr2) * nr^=(ulong) ((((uint) nr & 63)+nr2) *
((uint) default_charset_info->sort_order[(uint) *pos])) + (nr << 8); ((uint) seg->charset->sort_order[(uint) *pos])) + (nr << 8);
nr2+=3; nr2+=3;
} }
} }
...@@ -257,14 +256,13 @@ ulong hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec) ...@@ -257,14 +256,13 @@ ulong hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec)
} }
if (seg->type == HA_KEYTYPE_TEXT) if (seg->type == HA_KEYTYPE_TEXT)
{ {
if (default_charset_info->hash_sort) if (seg->charset->hash_sort)
default_charset_info->hash_sort(default_charset_info, seg->charset->hash_sort(seg->charset,pos,end-pos,&nr,&nr2);
pos,end-pos,&nr,&nr2);
else else
for (; pos < end ; pos++) for (; pos < end ; pos++)
{ {
nr^=(ulong) ((((uint) nr & 63)+nr2)* nr^=(ulong) ((((uint) nr & 63)+nr2)*
((uint) default_charset_info->sort_order[(uint) *pos]))+ (nr << 8); ((uint) seg->charset->sort_order[(uint) *pos]))+ (nr << 8);
nr2+=3; nr2+=3;
} }
} }
...@@ -397,7 +395,7 @@ int hp_rec_key_cmp(HP_KEYDEF *keydef, const byte *rec1, const byte *rec2) ...@@ -397,7 +395,7 @@ int hp_rec_key_cmp(HP_KEYDEF *keydef, const byte *rec1, const byte *rec2)
case HA_KEYTYPE_END: case HA_KEYTYPE_END:
return 0; return 0;
case HA_KEYTYPE_TEXT: case HA_KEYTYPE_TEXT:
if (my_sortcmp(default_charset_info,rec1+seg->start,rec2+seg->start,seg->length)) if (my_sortcmp(seg->charset,rec1+seg->start,rec2+seg->start,seg->length))
return 1; return 1;
break; break;
default: default:
...@@ -428,12 +426,7 @@ int hp_key_cmp(HP_KEYDEF *keydef, const byte *rec, const byte *key) ...@@ -428,12 +426,7 @@ int hp_key_cmp(HP_KEYDEF *keydef, const byte *rec, const byte *key)
} }
if (seg->type == HA_KEYTYPE_TEXT) if (seg->type == HA_KEYTYPE_TEXT)
{ {
/* if (my_sortcmp(seg->charset,rec+seg->start,key,seg->length))
BAR TODO: this will not use default_charset_info
I need Ram to apply his HEAP patches with
CHARSET_INFO field in HP segments
*/
if (my_sortcmp(default_charset_info,rec+seg->start,key,seg->length))
return 1; return 1;
} }
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment