mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
BUG#49481: RBR: MyISAM and bit fields may cause slave to stop on delete:
cant find record Some engines return data for the record. Despite the fact that the null bit is set for some fields, their old value may still in the row. This can happen when unpacking an AI from the binlog on top of a previous record in which a field is set to NULL, which previously contained a value. Ultimately, this may cause the comparison of records to fail when the slave is doing an index or range scan. We fix this by deploying a call to reset() for each field that is set to null while unpacking a row from the binary log. Furthermore, we also add mixed mode test case to cover the scenario where updating and setting a field to null through a Query event and later searching it through a rows event will succeed. Finally, we also change the reset() method, from Field_bit class, so that it takes into account bits stored among the null bits and not only the ones stored in the record. mysql-test/suite/rpl/t/rpl_set_null_innodb.test: InnoDB test. mysql-test/suite/rpl/t/rpl_set_null_myisam.test: MyISAM test. mysql-test/suite/rpl_ndb/t/rpl_ndb_set_null.test: NDB test. sql/field.h: Changed reset so that it also clears the bits among the null_bits for the Field_bit class. sql/rpl_record.cc: Resetting field after setting it to null when unpacking row.
This commit is contained in:
@@ -231,6 +231,17 @@ unpack_row(Relay_log_info const *rli,
|
||||
{
|
||||
DBUG_PRINT("debug", ("Was NULL; null mask: 0x%x; null bits: 0x%x",
|
||||
null_mask, null_bits));
|
||||
/**
|
||||
Calling reset just in case one is unpacking on top a
|
||||
record with data.
|
||||
|
||||
This could probably go into set_null() but doing so,
|
||||
(i) triggers assertion in other parts of the code at
|
||||
the moment; (ii) it would make us reset the field,
|
||||
always when setting null, which right now doesn't seem
|
||||
needed anywhere else except here.
|
||||
*/
|
||||
f->reset();
|
||||
f->set_null();
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user