summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <bar@bar.mysql.r18.ru>2002-10-10 17:14:56 +0500
committerunknown <bar@bar.mysql.r18.ru>2002-10-10 17:14:56 +0500
commit08f44a43658eea5034a35b706ae65c678be0160b (patch)
treef3903780ba0e86bebf8e27358f4e75626afdd495
parent72174d5b8207363aaf22dbc7b0b85d9bfa9505ab (diff)
downloadmariadb-git-08f44a43658eea5034a35b706ae65c678be0160b.tar.gz
Don't use sort_order directly
-rw-r--r--heap/hp_hash.c12
-rw-r--r--myisam/mi_unique.c17
2 files changed, 5 insertions, 24 deletions
diff --git a/heap/hp_hash.c b/heap/hp_hash.c
index ea48bd0c947..e28f4725caf 100644
--- a/heap/hp_hash.c
+++ b/heap/hp_hash.c
@@ -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
{
diff --git a/myisam/mi_unique.c b/myisam/mi_unique.c
index 2101c656324..682f946eba7 100644
--- a/myisam/mi_unique.c
+++ b/myisam/mi_unique.c
@@ -99,20 +99,9 @@ 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));
- }
+ ulong nr=1, nr2=4;
+ keyseg->charset->hash_sort(keyseg->charset,(const uchar*)pos,length,&nr, &nr2);
+ crc=nr;
}
else
while (pos != end)