mariadb/sql
unknown 0b1c0f3173 Bug#31702 (Missing row on slave causes assertion failure under row-based replication):
When replicating an update pair (before image, after image) under row-based
replication, and the before image is not found on the slave, the after image
was not discared, and was hence read as a before image for the next row.
Eventually, this lead to an after image being read outside the block of rows
in the event, causing an assertion to fire.

This patch fixes this by reading the after image in the event that the row
was not found on the slave, adds some extra debug assertion to catch future
errors earlier, and also adds a few non-debug checks to prevent reading
outside the block of the event.


include/my_base.h:
  Adding error code HA_ERR_CORRUPT_EVENT.
mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result:
  Result change.
mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test:
  Adding test to try to use row-based replication to replicate an
  update of a row that doesn't exist on the slave. We should get
  an apropriate error and the slave should stop.
sql/log_event.cc:
  Adding debug printouts. Adding code to Update_rows_log_event::do_exec_row()
  so that the after image is read (and ignored) in the event of an error in
  finding the row. This is necessary so that the second pair of images is
  read correctly for the next update pair.
  
  Changing logic for ignoring errors to not include update events, since
  a "key not found" error or a "record changed" error is not idempotent
  for updates, just for deletes and inserts.
sql/log_event.h:
  Adding debug assertions to check that row reading is within the events block of rows.
2007-10-20 18:19:55 +02:00
..
examples
share
.cvsignore
add_errmsg
authors.h
client_settings.h
CMakeLists.txt
contributors.h
custom_conf.h
derror.cc
des_key_file.cc
discover.cc
event_data_objects.cc
event_data_objects.h
event_db_repository.cc
event_db_repository.h
event_queue.cc
event_queue.h
event_scheduler.cc
event_scheduler.h
events.cc
events.h
field.cc BUG#29549 (Endians: rpl_ndb_myisam2ndb,rpl_ndb_innodb2ndb and rpl_ndb_mix_innodb failed on): 2007-10-12 18:22:31 +02:00
field.h
field_conv.cc
filesort.cc
frm_crypt.cc
gen_lex_hash.cc
gstream.cc
gstream.h
ha_ndbcluster.cc Eliminating some valgrind warnings resulting from that some 2007-10-17 06:50:03 +02:00
ha_ndbcluster.h
ha_ndbcluster_binlog.cc
ha_ndbcluster_binlog.h
ha_ndbcluster_cond.cc
ha_ndbcluster_cond.h
ha_ndbcluster_tables.h
ha_partition.cc
ha_partition.h
handler.cc
handler.h
hash_filo.cc
hash_filo.h
hostname.cc
init.cc
item.cc
item.h
item_buff.cc
item_cmpfunc.cc Merge mysql.com:/home/bar/mysql-work/mysql-5.0.b31081 2007-10-16 15:04:04 +05:00
item_cmpfunc.h Merge mysql.com:/home/bar/mysql-work/mysql-5.0.b31081 2007-10-16 15:04:04 +05:00
item_create.cc
item_create.h
item_func.cc
item_func.h
item_geofunc.cc
item_geofunc.h
item_row.cc
item_row.h
item_strfunc.cc
item_strfunc.h
item_subselect.cc
item_subselect.h
item_sum.cc
item_sum.h
item_timefunc.cc
item_timefunc.h
item_xmlfunc.cc
item_xmlfunc.h
key.cc
lex.h
lex_symbol.h
lock.cc
log.cc
log.h
log_event.cc Bug#31702 (Missing row on slave causes assertion failure under row-based replication): 2007-10-20 18:19:55 +02:00
log_event.h Bug#31702 (Missing row on slave causes assertion failure under row-based replication): 2007-10-20 18:19:55 +02:00
log_event_old.cc
log_event_old.h
Makefile.am
matherr.c
message.mc
mf_iocache.cc
my_decimal.cc
my_decimal.h
my_lock.c
mysql_priv.h
mysqld.cc
mysqld_suffix.h
net_serv.cc
nt_servc.cc
nt_servc.h
opt_range.cc
opt_range.h
opt_sum.cc
parse_file.cc
parse_file.h
partition_element.h
partition_info.cc
partition_info.h
password.c
procedure.cc
procedure.h
protocol.cc
protocol.h
records.cc Eliminating some valgrind warnings resulting from that some 2007-10-17 06:50:03 +02:00
repl_failsafe.cc
repl_failsafe.h
rpl_constants.h
rpl_filter.cc
rpl_filter.h
rpl_injector.cc
rpl_injector.h
rpl_mi.cc
rpl_mi.h
rpl_record.cc Removing debug variables from non-debug builds. 2007-10-17 09:29:11 +02:00
rpl_record.h
rpl_record_old.cc
rpl_record_old.h
rpl_reporting.cc
rpl_reporting.h
rpl_rli.cc manual merge for bug_29136, bug#29309. 2007-10-13 23:12:50 +03:00
rpl_rli.h
rpl_tblmap.cc
rpl_tblmap.h
rpl_utility.cc
rpl_utility.h
scheduler.cc
scheduler.h
set_var.cc
set_var.h
slave.cc Merge koti.dsl.inet.fi:/home/elkin/MySQL/TEAM/FIXES/5.0/bug29136-mdelete 2007-10-13 16:51:16 +03:00
slave.h
sp.cc
sp.h
sp_cache.cc
sp_cache.h
sp_head.cc
sp_head.h
sp_pcontext.cc
sp_pcontext.h
sp_rcontext.cc
sp_rcontext.h
spatial.cc
spatial.h
sql_acl.cc
sql_acl.h
sql_analyse.cc
sql_analyse.h
sql_array.h
sql_base.cc
sql_binlog.cc
sql_bitmap.h
sql_builtin.cc.in
sql_cache.cc
sql_cache.h
sql_class.cc
sql_class.h Merge koti.dsl.inet.fi:/home/elkin/MySQL/TEAM/FIXES/5.0/bug29136-mdelete 2007-10-13 16:51:16 +03:00
sql_client.cc
sql_connect.cc
sql_crypt.cc
sql_crypt.h
sql_cursor.cc
sql_cursor.h
sql_db.cc
sql_delete.cc manual merge for bug_29136, bug#29309. 2007-10-13 23:12:50 +03:00
sql_derived.cc
sql_do.cc
sql_error.cc
sql_error.h
sql_handler.cc
sql_help.cc
sql_insert.cc
sql_lex.cc
sql_lex.h
sql_list.cc
sql_list.h
sql_load.cc
sql_locale.cc
sql_manager.cc
sql_map.cc
sql_map.h
sql_olap.cc
sql_parse.cc Merge koti.dsl.inet.fi:/home/elkin/MySQL/TEAM/FIXES/5.0/bug29136-mdelete 2007-10-13 16:51:16 +03:00
sql_partition.cc
sql_partition.h
sql_plugin.cc
sql_plugin.h
sql_prepare.cc
sql_rename.cc
sql_repl.cc
sql_repl.h
sql_select.cc
sql_select.h
sql_servers.cc
sql_servers.h
sql_show.cc Merge mkindahl@bk-internal.mysql.com:/home/bk/mysql-5.1-new-rpl 2007-10-12 13:24:28 +02:00
sql_show.h
sql_sort.h
sql_state.c
sql_string.cc
sql_string.h
sql_table.cc
sql_tablespace.cc
sql_test.cc
sql_trigger.cc
sql_trigger.h
sql_udf.cc
sql_udf.h
sql_union.cc
sql_update.cc Merge koti.dsl.inet.fi:/home/elkin/MySQL/TEAM/FIXES/5.0/bug29136-mdelete 2007-10-13 16:51:16 +03:00
sql_view.cc
sql_view.h
sql_yacc.yy
stacktrace.c
stacktrace.h
strfunc.cc
structs.h
table.cc
table.h
thr_malloc.cc
time.cc
tzfile.h
tztime.cc
tztime.h
udf_example.c
udf_example.def
uniques.cc
unireg.cc
unireg.h