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 Bug #38360: BLACKHOLE replication with RBR is broken 2008-10-02 21:13:15 +02:00
rpl_charset.test Fix after merge 2008-02-28 18:55:46 +01:00
rpl_commit_after_flush.test fixes Bug #25305 (and several other similar test tailures with the same symptom) 2007-06-18 15:36:10 +02:00
rpl_conflicts.test BUG#37718: rpl.rpl_stm_mystery22 fails sporadically on pushbuild 2009-01-09 15:12:31 +01:00
rpl_ddl.test Upmerge 5.0 -> 5.1 of fix for 2008-08-25 15:09:51 +02:00
rpl_deadlock.test Bug#37716. 2009-04-04 01:33:13 +04:00
rpl_delete_no_where.test fixes Bug #25305 (and several other similar test tailures with the same symptom) 2007-06-18 15:36:10 +02:00
rpl_EE_err.test Merging 5.1 main into 5.1-rpl 2008-10-23 21:27:09 +02:00
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 Bug#31552 Replication breaks when deleting rows from out-of-sync table 2007-12-12 12:14:59 +02:00
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 fixing the 5.1-opt merge of the fix for bug 29571: 2007-07-27 17:29:48 +03:00
rpl_insert_id.test Bug #32124: crash if prepared statements refer to variables in the where clause 2008-10-08 14:23:53 +03:00
rpl_insert_id_pk.test Bug #28842 Different 'duplicate key' error code between 5.0 and 5.1 2007-06-06 10:57:07 -07:00
rpl_insert_ignore.test fixes Bug #25305 (and several other similar test tailures with the same symptom) 2007-06-18 15:36:10 +02:00
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 Fix for versional test 2008-01-14 15:38:02 +08:00
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 Merge romeo.(none):/home/bkroot/mysql-5.1-new-rpl 2007-03-29 21:38:03 +02:00
rpl_multi_update.test
rpl_multi_update2.test fixes Bug #25305 (and several other similar test tailures with the same symptom) 2007-06-18 15:36:10 +02:00
rpl_multi_update3.test fixes Bug #25305 (and several other similar test tailures with the same symptom) 2007-06-18 15:36:10 +02:00
rpl_ndb_2multi_basic.test BUG#21842 (Cluster fails to replicate to innodb or myisam with err 134 2007-08-26 14:31:10 +02:00
rpl_ndb_2multi_eng.test Problem: pushbuild has sporadic errors during startup of 2008-02-11 15:14:24 +01:00
rpl_ndb_apply_status.test correct merge error 2008-02-14 00:02:25 +01:00
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 Bug#18436 (RBR: Replication to partition engine triggers assertion on slave): 2006-03-27 14:58:37 +02:00
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 fixes Bug #25305 (and several other similar test tailures with the same symptom) 2007-06-18 15:36:10 +02:00
rpl_reset_slave.test BUG#44270: Post-push fix 2009-06-26 12:05:56 +01:00
rpl_row_001.test Use absolute path to allow tets to be run also when datadir differs 2007-12-19 09:42:31 +01:00
rpl_row_basic.test bug#38230 2008-11-06 19:10:09 +02:00
rpl_row_blob.test fixes Bug #25305 (and several other similar test tailures with the same symptom) 2007-06-18 15:36:10 +02:00
rpl_row_delayed_ins.test BUG#29020 (Event results not correctly replicated to slave in RBR): 2008-03-28 13:16:41 +01:00
rpl_row_func003.test BUG#49222: Mark RAND() as unsafe 2010-01-13 10:00:03 +01:00
rpl_row_sp002.test Bug #32307 mysqltest - does not detect illegal if syntax 2008-08-04 12:38:50 +02:00
rpl_row_sp003.test fixes Bug #25305 (and several other similar test tailures with the same symptom) 2007-06-18 15:36:10 +02:00
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 BUG#28722 (Multi-engine statements on has_own_binlogging engine): 2007-06-22 01:39:23 +02:00
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 BUG#38350: Many tests don't clean up after themselves on exit. 2008-11-13 20:19:00 +01:00
rpl_sv_relay_space.test Bug#16993 (ALTER TABLE ZEROFILL AUTO_INCREMENT not replicated correctly): 2006-04-19 15:29:49 +02:00
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 Bug #28842 Different 'duplicate key' error code between 5.0 and 5.1 2007-06-06 10:57:07 -07:00
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