summaryrefslogtreecommitdiff
path: root/sql/log_event.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r--sql/log_event.cc34
1 files changed, 14 insertions, 20 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 4bce6fa3157..c550adea26b 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -5550,22 +5550,6 @@ int Query_log_event::do_apply_event(rpl_group_info *rgi,
else
thd->variables.collation_database= thd->db_charset;
- {
- const CHARSET_INFO *cs= thd->charset();
- /*
- We cannot ask for parsing a statement using a character set
- without state_maps (parser internal data).
- */
- if (!cs->state_map)
- {
- rli->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR,
- ER_THD(thd, ER_SLAVE_FATAL_ERROR),
- "character_set cannot be parsed");
- thd->is_slave_error= true;
- goto end;
- }
- }
-
/*
Record any GTID in the same transaction, so slave state is
transactionally consistent.
@@ -13636,6 +13620,16 @@ void issue_long_find_row_warning(Log_event_type type,
}
+/*
+ HA_ERR_KEY_NOT_FOUND is a fatal error normally, but it's an expected
+ error in speculate optimistic mode, so use something non-fatal instead
+*/
+static int row_not_found_error(rpl_group_info *rgi)
+{
+ return rgi->speculation != rpl_group_info::SPECULATE_OPTIMISTIC
+ ? HA_ERR_KEY_NOT_FOUND : HA_ERR_RECORD_CHANGED;
+}
+
/**
Locate the current row in event's table.
@@ -13733,14 +13727,12 @@ int Rows_log_event::find_row(rpl_group_info *rgi)
int error;
DBUG_PRINT("info",("locating record using primary key (position)"));
- if (!table->file->inited &&
- (error= table->file->ha_rnd_init_with_error(0)))
- DBUG_RETURN(error);
-
error= table->file->ha_rnd_pos_by_record(table->record[0]);
if (unlikely(error))
{
DBUG_PRINT("info",("rnd_pos returns error %d",error));
+ if (error == HA_ERR_KEY_NOT_FOUND)
+ error= row_not_found_error(rgi);
table->file->print_error(error, MYF(0));
}
DBUG_RETURN(error);
@@ -13806,6 +13798,8 @@ int Rows_log_event::find_row(rpl_group_info *rgi)
HA_READ_KEY_EXACT))))
{
DBUG_PRINT("info",("no record matching the key found in the table"));
+ if (error == HA_ERR_KEY_NOT_FOUND)
+ error= row_not_found_error(rgi);
table->file->print_error(error, MYF(0));
table->file->ha_index_end();
goto end;