diff options
author | unknown <mats@kindahl-laptop.dnsalias.net> | 2007-10-20 18:19:55 +0200 |
---|---|---|
committer | unknown <mats@kindahl-laptop.dnsalias.net> | 2007-10-20 18:19:55 +0200 |
commit | 0b1c0f3173cd14181ece774cdbbf68dddedf35a7 (patch) | |
tree | 67b8c0cdc0b3f7505963dd948bda591a8175e8e0 /include/my_base.h | |
parent | 3f284594be3988a8e24d579444033f3884b8ead5 (diff) | |
download | mariadb-git-0b1c0f3173cd14181ece774cdbbf68dddedf35a7.tar.gz |
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.
Diffstat (limited to 'include/my_base.h')
-rw-r--r-- | include/my_base.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/my_base.h b/include/my_base.h index 339554979a8..e65a04bb16d 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -407,9 +407,11 @@ enum ha_base_keytype { #define HA_ERR_RECORD_IS_THE_SAME 169 /* row not actually updated : new values same as the old values */ -#define HA_ERR_LOGGING_IMPOSSIBLE 170 /* It is not possible to log this - statement */ -#define HA_ERR_LAST 170 /*Copy last error nr.*/ +#define HA_ERR_LOGGING_IMPOSSIBLE 170 /* It is not possible to log this + statement */ +#define HA_ERR_CORRUPT_EVENT 171 /* The event was corrupt, leading to + illegal data being read */ +#define HA_ERR_LAST 171 /*Copy last error nr.*/ /* Add error numbers before HA_ERR_LAST and change it accordingly. */ #define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1) |