Commit 08f44a43 authored by unknown's avatar unknown

Don't use sort_order directly

parent 72174d5b
...@@ -301,11 +301,7 @@ ulong hp_hashnr(register HP_KEYDEF *keydef, register const byte *key) ...@@ -301,11 +301,7 @@ ulong hp_hashnr(register HP_KEYDEF *keydef, register const byte *key)
} }
if (seg->type == HA_KEYTYPE_TEXT) if (seg->type == HA_KEYTYPE_TEXT)
{ {
for (; pos < (uchar*) key ; pos++) seg->charset->hash_sort(seg->charset,pos,((uchar*)key)-pos,&nr,NULL);
{
nr *=16777619;
nr ^=((uint) my_sort_order[(uint) *pos]);
}
} }
else else
{ {
...@@ -339,11 +335,7 @@ ulong hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec) ...@@ -339,11 +335,7 @@ ulong hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec)
} }
if (seg->type == HA_KEYTYPE_TEXT) if (seg->type == HA_KEYTYPE_TEXT)
{ {
for ( ; pos < end ; pos++) seg->charset->hash_sort(seg->charset,pos,((uchar*)key)-pos,&nr,NULL);
{
nr *=16777619;
nr ^=(uint) my_sort_order[(uint) *pos];
}
} }
else else
{ {
......
...@@ -98,22 +98,11 @@ ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const byte *record) ...@@ -98,22 +98,11 @@ ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const byte *record)
} }
end= pos+length; end= pos+length;
if (type == HA_KEYTYPE_TEXT || type == HA_KEYTYPE_VARTEXT) if (type == HA_KEYTYPE_TEXT || type == HA_KEYTYPE_VARTEXT)
{
if (keyseg->charset->hash_sort)
{ {
ulong nr=1, nr2=4; ulong nr=1, nr2=4;
keyseg->charset->hash_sort(keyseg->charset,(const uchar*)pos,length,&nr, &nr2); keyseg->charset->hash_sort(keyseg->charset,(const uchar*)pos,length,&nr, &nr2);
crc=nr; crc=nr;
} }
else
{
uchar *sort_order=keyseg->charset->sort_order;
while (pos != end)
crc=((crc << 8) +
(((uchar) sort_order[*(uchar*) pos++]))) +
(crc >> (8*sizeof(ha_checksum)-8));
}
}
else else
while (pos != end) while (pos != end)
crc=((crc << 8) + crc=((crc << 8) +
......
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