Commit 69dc5ef8 authored by bar@bar.mysql.r18.ru's avatar bar@bar.mysql.r18.ru

Don't use sort_order directly

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