summaryrefslogtreecommitdiff
path: root/myisam/mi_unique.c
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2004-06-18 03:02:29 +0300
committerunknown <monty@mysql.com>2004-06-18 03:02:29 +0300
commit9fa13ebeaa2824606bfc9782b1fa7849f8264cbf (patch)
treebbef0bb6fad673089610709f1981fd9f249b7833 /myisam/mi_unique.c
parentcb404ee78ffb2730935677fa5c8877f33995c105 (diff)
downloadmariadb-git-9fa13ebeaa2824606bfc9782b1fa7849f8264cbf.tar.gz
Fixed some byte order bugs with prepared statements on machines with high-byte-first. (Bug #4173)
Fixed problem with NULL and derived tables (Bug #4097) Cleanup of new pushed code BitKeeper/etc/ignore: added mysql-test/ndb/ndbcluster client/mysqltest.c: simple cleanup innobase/os/os0file.c: fix for netware libmysql/libmysql.c: Fixed some byte order bugs with prepared statements on machines with high-byte-first. (Bug #4173) myisam/ft_boolean_search.c: Comment cleanup myisam/mi_check.c: Removed not needed check (check is done in check_index()) myisam/mi_unique.c: crc must be of type ha_checksum. myisam/myisamchk.c: Portability fix. mysql-test/mysql-test-run.sh: Simple cleanup mysql-test/r/subselect.result: Test problem with NULL and derived tables (Bug #4097) mysql-test/t/subselect.test: Test problem with NULL and derived tables (Bug #4097) sql/mysqld.cc: Remove not used defines sql/sql_select.cc: Fixed problem with NULL and derived tables (Bug #4097) Indentation fixes sql/sql_string.cc: Code cleanup sql/sql_yacc.yy: Allow one to use DROP PREPARE ...
Diffstat (limited to 'myisam/mi_unique.c')
-rw-r--r--myisam/mi_unique.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/myisam/mi_unique.c b/myisam/mi_unique.c
index 06d50e6905b..77e967e52e2 100644
--- a/myisam/mi_unique.c
+++ b/myisam/mi_unique.c
@@ -69,7 +69,7 @@ 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;
- ulong crc= 0;
+ ha_checksum crc= 0;
ulong seed= 4;
HA_KEYSEG *keyseg;
@@ -109,8 +109,11 @@ ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const byte *record)
end= pos+length;
if (type == HA_KEYTYPE_TEXT || type == HA_KEYTYPE_VARTEXT)
{
+ ulong tmp= 0;
keyseg->charset->coll->hash_sort(keyseg->charset,
- (const uchar*) pos, length, &crc, &seed);
+ (const uchar*) pos, length, &tmp,
+ &seed);
+ crc^= tmp;
}
else
while (pos != end)
@@ -118,7 +121,7 @@ ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const byte *record)
(((uchar) *(uchar*) pos++))) +
(crc >> (8*sizeof(ha_checksum)-8));
}
- return (ha_checksum)crc;
+ return crc;
}
/*