mariadb/mysql-test/extra/rpl_tests
Luis Soares fbe81e3c97 BUG#52868: Wrong handling of NULL value during update, replication out
of sync

In RBR, sometimes the table->s->last_null_bit_pos can be zero. This
has impact at the slave when it compares records fetched from the
storage engine against records in the binary log event. If
last_null_bit_pos is zero the slave, while comparing in
log_event.cc:record_compare function, would set all bits in the last
null_byte to 1 (assumed all 8 were unused) . Thence it would loose the
ability to distinguish records that were similar in contents except
for the fact that some field was null in one record, but not in the
other. Ultimately this would cause wrong matches, and in the specific
case depicted in the bug report the same record would be updated
twice, resulting in a lost update.

Additionally, in the record_compare function the slave was setting the
X bit unconditionally. There are cases that the X bit does not exist
in the record header. This could also lead to wrong matches between
records.

We fix both by conditionally resetting the bits: (i) unused null_bits
are set if last_null_bit_pos > 0; (ii) X bit is set if
HA_OPTION_PACK_RECORD is in use.

mysql-test/extra/rpl_tests/rpl_record_compare.test:
  Shared part of the test case for MyISAM and InnoDB.
mysql-test/suite/rpl/t/rpl_row_rec_comp_innodb.test:
  InnoDB test case.
mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test:
  MyISAM test case. Added also coverage for Field_bits case.
sql/log_event.cc:
  Deployed conditional setting of unused bits at record_compare.
sql/log_event_old.cc:
  Same change as in log_event.cc.
2010-04-21 13:47:55 +01:00
..
rpl_auto_increment.test BUG#45999 Row based replication fails when auto_increment field = 0 2009-09-10 18:05:53 +08:00
rpl_auto_increment_insert_view.test Bug #45677 Slave stops with Duplicate entry for key PRIMARY when using trigger 2009-10-01 07:19:36 +08:00
rpl_auto_increment_invoke_trigger.test Bug #45677 Slave stops with Duplicate entry for key PRIMARY when using trigger 2009-10-01 07:19:36 +08:00
rpl_autoinc_func_invokes_trigger.test Bug #45677 Slave stops with Duplicate entry for key PRIMARY when using trigger 2009-10-01 07:19:36 +08:00
rpl_blackhole.test
rpl_charset.test
rpl_commit_after_flush.test
rpl_conflicts.test BUG#37718: rpl.rpl_stm_mystery22 fails sporadically on pushbuild 2009-01-09 15:12:31 +01:00
rpl_ddl.test
rpl_deadlock.test Bug#37716. 2009-04-04 01:33:13 +04:00
rpl_delete_no_where.test
rpl_EE_err.test
rpl_extraMaster_Col.test Bug #39265: fix for the bug 33699 should be reverted 2009-02-05 13:49:32 +04:00
rpl_extraSlave_Col.test BUG#48091 valgrind errors when slave has double not null and master has double null 2009-10-22 01:21:50 +01:00
rpl_failed_optimize.test BUG#44661: rpl_ndb.rpl_ndb_circular_simplex fails because of 2009-09-27 23:03:05 +01:00
rpl_flsh_tbls.test Bug#41108: It is a testcase timeout bug so the patch fixes test code in places 2008-12-12 14:34:18 +03:00
rpl_foreign_key.test
rpl_get_master_version_and_clock.test Bug #51648 DBUG_SYNC_POINT is not defined on all platforms and mtr cant pre-check that 2010-03-19 11:06:40 +02:00
rpl_insert_delayed.test
rpl_insert_id.test
rpl_insert_id_pk.test
rpl_insert_ignore.test
rpl_loaddata.test BUG#50451: rpl_loaddata_concurrent fails sporadically 2010-02-04 11:26:36 +00:00
rpl_loadfile.test BUG#39701: Mixed binlog format does not switch to row mode on 2009-03-24 18:27:33 +00:00
rpl_log.test Post-merge patch for extra/rpl_test/rpl_log.test: 2009-02-02 14:44:18 +03:00
rpl_max_relay_size.test
rpl_mixing_engines.inc BUG#46364 MyISAM transbuffer problems (NTM problem) 2010-01-20 19:08:16 +00:00
rpl_mixing_engines.test BUG#46864 Incorrect update of InnoDB table on slave when using trigger with myisam table 2009-08-27 13:46:29 +01:00
rpl_multi_query.test
rpl_multi_update.test
rpl_multi_update2.test
rpl_multi_update3.test
rpl_ndb_2multi_basic.test
rpl_ndb_2multi_eng.test
rpl_ndb_apply_status.test
rpl_not_null.test BUG#48091 valgrind errors when slave has double not null and master has double null 2009-10-22 01:19:52 +01:00
rpl_partition.test
rpl_record_compare.test BUG#52868: Wrong handling of NULL value during update, replication out 2010-04-21 13:47:55 +01:00
rpl_relayrotate.test
rpl_reset_slave.test BUG#44270: Post-push fix 2009-06-26 12:05:56 +01:00
rpl_row_001.test
rpl_row_basic.test
rpl_row_blob.test
rpl_row_delayed_ins.test
rpl_row_func003.test BUG#49222: Mark RAND() as unsafe 2010-01-13 10:00:03 +01:00
rpl_row_sp002.test
rpl_row_sp003.test
rpl_row_sp006.test BUG#45581 Test rpl_row_sp006_InnoDB fails randomly: Unknown database 'mysqltest1' 2009-09-04 09:33:45 +08:00
rpl_row_sp007.test
rpl_row_tabledefs.test BUG#48091 valgrind errors when slave has double not null and master has double null 2009-10-22 01:10:42 +01:00
rpl_row_UUID.test
rpl_set_null.test BUG#49481: RBR: MyISAM and bit fields may cause slave to stop on delete: 2010-01-21 17:20:24 +00:00
rpl_stm_000001.test BUG#47995: Mark system functions as unsafe 2009-11-18 15:50:31 +01:00
rpl_stm_EE_err2.test
rpl_sv_relay_space.test
rpl_tmp_table_and_DDL.test Bug #49132 Replication failure on temporary table + DDL 2010-01-22 17:38:21 +08:00
rpl_trig004.test
rpl_truncate.test Bug #36763 2009-02-06 17:06:41 +01:00
rpl_truncate_helper.test Bug #36763 2009-02-06 17:06:41 +01:00