summaryrefslogtreecommitdiff
path: root/myisam/mi_unique.c
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2003-01-18 03:13:37 +0200
committerunknown <monty@mashka.mysql.fi>2003-01-18 03:13:37 +0200
commit931c816271018c30210afc3f6577821185c3d465 (patch)
treeb24bce166fd5affbcc506bbc7d70c2c7ef00f561 /myisam/mi_unique.c
parent8624debf4ec73b3c35b4178249d7bf566a9ab892 (diff)
parent33687be627386b540fac78ed709f18b9fae9df17 (diff)
downloadmariadb-git-931c816271018c30210afc3f6577821185c3d465.tar.gz
Merge with 4.0.9
BitKeeper/etc/ignore: auto-union client/mysqltest.c: Auto merged configure.in: Auto merged BitKeeper/deleted/.del-mutex.h~d3ae7a2977a68137: Auto merged BitKeeper/deleted/.del-mutex.m4~a13383cde18a64e1: Auto merged innobase/btr/btr0cur.c: Auto merged innobase/btr/btr0pcur.c: Auto merged innobase/log/log0log.c: Auto merged innobase/srv/srv0srv.c: Auto merged innobase/trx/trx0trx.c: Auto merged myisam/mi_create.c: Auto merged myisam/mi_unique.c: Auto merged myisam/myisamchk.c: Auto merged mysql-test/mysql-test-run.sh: Auto merged mysql-test/r/group_by.result: Auto merged mysql-test/r/merge.result: Auto merged mysql-test/r/null.result: Auto merged mysql-test/t/group_by.test: Auto merged mysql-test/t/merge.test: Auto merged mysql-test/t/null.test: Auto merged scripts/mysql_fix_privilege_tables.sh: Auto merged sql/field_conv.cc: Auto merged sql/ha_myisammrg.cc: Auto merged sql/mysqld.cc: Auto merged sql/net_serv.cc: Auto merged sql/opt_sum.cc: Auto merged sql/protocol.cc: Auto merged sql/sql_db.cc: Auto merged sql/sql_load.cc: Auto merged sql/sql_table.cc: Auto merged strings/Makefile.am: Auto merged libmysql/Makefile.shared: merge libmysql/libmysql.def: merge sql/ha_innodb.cc: merge sql/item_cmpfunc.cc: merge sql/log_event.cc: merge sql/sql_handler.cc: merge
Diffstat (limited to 'myisam/mi_unique.c')
-rw-r--r--myisam/mi_unique.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/myisam/mi_unique.c b/myisam/mi_unique.c
index 682f946eba7..3eb25aefe0e 100644
--- a/myisam/mi_unique.c
+++ b/myisam/mi_unique.c
@@ -24,7 +24,7 @@ my_bool mi_check_unique(MI_INFO *info, MI_UNIQUEDEF *def, byte *record,
{
my_off_t lastpos=info->lastpos;
MI_KEYDEF *key= &info->s->keyinfo[def->key];
- uchar *key_buff=info->lastkey+info->s->base.max_key_length;
+ uchar *key_buff=info->lastkey2;
DBUG_ENTER("mi_check_unique");
mi_unique_store(record+key->seg->start, unique_hash);
@@ -80,7 +80,16 @@ ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const byte *record)
if (keyseg->null_bit)
{
if (record[keyseg->null_pos] & keyseg->null_bit)
+ {
+ /*
+ Change crc in a way different from an empty string or 0.
+ (This is an optimisation; The code will work even if this isn't
+ done)
+ */
+ crc=((crc << 8) + 511+
+ (crc >> (8*sizeof(ha_checksum)-8)));
continue;
+ }
}
pos= record+keyseg->start;
if (keyseg->flag & HA_VAR_LENGTH)