diff options
author | Luis Soares <luis.soares@oracle.com> | 2011-03-25 12:13:17 +0000 |
---|---|---|
committer | Luis Soares <luis.soares@oracle.com> | 2011-03-25 12:13:17 +0000 |
commit | 9b505d023732d41372dd6704a28557707a4fc234 (patch) | |
tree | 55c54aa4488de8c12de54a3a7c208a808f3cb13c /sql | |
parent | 11ca6e2ca403e2eb6e79b92110032cfe01a9d8bb (diff) | |
parent | f24b6702e96cabf12c43e99d0b27276fcbce5d43 (diff) | |
download | mariadb-git-9b505d023732d41372dd6704a28557707a4fc234.tar.gz |
BUG#11766865: Automerged mysql-5.1 into mysql-5.5.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/log_event.cc | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc index b9da915ba96..39b4791ff3d 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -9052,7 +9052,19 @@ static bool record_compare(TABLE *table) } } - if (table->s->blob_fields + table->s->varchar_fields == 0) + /** + Compare full record only if: + - there are no blob fields (otherwise we would also need + to compare blobs contents as well); + - there are no varchar fields (otherwise we would also need + to compare varchar contents as well); + - there are no null fields, otherwise NULLed fields + contents (i.e., the don't care bytes) may show arbitrary + values, depending on how each engine handles internally. + */ + if ((table->s->blob_fields + + table->s->varchar_fields + + table->s->null_fields) == 0) { result= cmp_record(table,record[1]); goto record_compare_exit; @@ -9067,13 +9079,22 @@ static bool record_compare(TABLE *table) goto record_compare_exit; } - /* Compare updated fields */ + /* Compare fields */ for (Field **ptr=table->field ; *ptr ; ptr++) { - if ((*ptr)->cmp_binary_offset(table->s->rec_buff_length)) + + /** + We only compare field contents that are not null. + NULL fields (i.e., their null bits) were compared + earlier. + */ + if (!(*(ptr))->is_null()) { - result= TRUE; - goto record_compare_exit; + if ((*ptr)->cmp_binary_offset(table->s->rec_buff_length)) + { + result= TRUE; + goto record_compare_exit; + } } } |