summaryrefslogtreecommitdiff
path: root/myisam/mi_unique.c
diff options
context:
space:
mode:
Diffstat (limited to 'myisam/mi_unique.c')
-rw-r--r--myisam/mi_unique.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/myisam/mi_unique.c b/myisam/mi_unique.c
index 38b4ed93311..ad685f4cbdc 100644
--- a/myisam/mi_unique.c
+++ b/myisam/mi_unique.c
@@ -69,7 +69,8 @@ my_bool mi_check_unique(MI_INFO *info, MI_UNIQUEDEF *def, byte *record,
ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const byte *record)
{
const byte *pos, *end;
- ha_checksum crc=0;
+ ha_checksum crc= 0;
+ ulong seed1=0, seed2= 4;
HA_KEYSEG *keyseg;
for (keyseg=def->seg ; keyseg < def->end ; keyseg++)
@@ -108,9 +109,10 @@ ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const byte *record)
end= pos+length;
if (type == HA_KEYTYPE_TEXT || type == HA_KEYTYPE_VARTEXT)
{
- ulong nr=1, nr2=4;
- keyseg->charset->coll->hash_sort(keyseg->charset,(const uchar*)pos,length,&nr, &nr2);
- crc=nr;
+ keyseg->charset->coll->hash_sort(keyseg->charset,
+ (const uchar*) pos, length, &seed1,
+ &seed2);
+ crc^= seed1;
}
else
while (pos != end)