mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Manual merge of mysql-5.1-bugteam into mysql-trunk-merge.
This commit is contained in:
@ -8733,24 +8733,6 @@ static bool record_compare(TABLE *table)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Check if we are using MyISAM.
|
||||
|
||||
If this is a myisam table, then we cannot do a memcmp
|
||||
right away because some NULL fields can still contain
|
||||
an old value in the row - they are not shown to the user
|
||||
because the null bit is set, however, the contents are
|
||||
not cleared. As such, plain memory comparison cannot be
|
||||
assured to work. See: BUG#49482 and BUG#49481.
|
||||
|
||||
On top of this, we do not store field contents for null
|
||||
fields in the binlog, so this is extra important when
|
||||
comparing records fetched from binlog and from storage
|
||||
engine.
|
||||
*/
|
||||
if (table->file->ht->db_type == DB_TYPE_MYISAM)
|
||||
goto record_compare_field_by_field;
|
||||
|
||||
if (table->s->blob_fields + table->s->varchar_fields == 0)
|
||||
{
|
||||
result= cmp_record(table,record[1]);
|
||||
@ -8766,33 +8748,14 @@ static bool record_compare(TABLE *table)
|
||||
goto record_compare_exit;
|
||||
}
|
||||
|
||||
record_compare_field_by_field:
|
||||
|
||||
/* Compare updated fields */
|
||||
for (Field **ptr=table->field ; *ptr ; ptr++)
|
||||
{
|
||||
Field *f= *ptr;
|
||||
|
||||
/* if just one of the fields is null then there is no match */
|
||||
if ((f->is_null_in_record(table->record[0])) ==
|
||||
!(f->is_null_in_record(table->record[1])))
|
||||
if ((*ptr)->cmp_binary_offset(table->s->rec_buff_length))
|
||||
{
|
||||
result= TRUE;
|
||||
goto record_compare_exit;
|
||||
}
|
||||
|
||||
/* if both fields are not null then we can compare */
|
||||
if (!(f->is_null_in_record(table->record[0])) &&
|
||||
!(f->is_null_in_record(table->record[1])))
|
||||
{
|
||||
if (f->cmp_binary_offset(table->s->rec_buff_length))
|
||||
{
|
||||
result= TRUE;
|
||||
goto record_compare_exit;
|
||||
}
|
||||
}
|
||||
|
||||
/* if both fields are null then there is a match. compare next field */
|
||||
}
|
||||
|
||||
record_compare_exit:
|
||||
|
Reference in New Issue
Block a user