summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVenkatesh Venugopal <venkatesh.venugopal@oracle.com>2019-04-25 18:01:49 +0200
committerSergei Golubchik <serg@mariadb.org>2019-04-25 18:03:00 +0200
commitae1b8b9bf5d3e4b49d325be2e6cac74700e35e69 (patch)
tree8599f50e2debdc7f3732e70349c294f91a3933df
parent2be3ab977631085dff93f583cab91dc0b8c2178d (diff)
downloadmariadb-git-ae1b8b9bf5d3e4b49d325be2e6cac74700e35e69.tar.gz
Problem
------- MySQL abnormally exits on KILL command. Fix --- The abnormal exit has been fixed. RB: 20971, 21129, 21237
-rw-r--r--sql/log_event.cc26
-rw-r--r--sql/log_event_old.cc19
2 files changed, 24 insertions, 21 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc
index f84cfc94f6f..56ce3fab416 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -1,6 +1,6 @@
/*
- Copyright (c) 2000, 2018, Oracle and/or its affiliates.
- Copyright (c) 2009, 2018, MariaDB
+ Copyright (c) 2000, 2019, Oracle and/or its affiliates.
+ Copyright (c) 2009, 2019, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -48,6 +48,7 @@
#include "transaction.h"
#include <my_dir.h>
#include "sql_show.h" // append_identifier
+#include "debug_sync.h" // debug_sync
#endif /* MYSQL_CLIENT */
@@ -8512,25 +8513,28 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli)
/* A small test to verify that objects have consistent types */
DBUG_ASSERT(sizeof(thd->variables.option_bits) == sizeof(OPTION_RELAXED_UNIQUE_CHECKS));
+ DBUG_EXECUTE_IF("rows_log_event_before_open_table",
+ {
+ const char action[] = "now SIGNAL before_open_table WAIT_FOR go_ahead_sql";
+ DBUG_ASSERT(!debug_sync_set_action(thd, STRING_WITH_LEN(action)));
+ };);
+
if (open_and_lock_tables(thd, rli->tables_to_lock, FALSE, 0))
{
- uint actual_error= thd->stmt_da->sql_errno();
- if (thd->is_slave_error || thd->is_fatal_error)
+ if (thd->is_error())
{
/*
Error reporting borrowed from Query_log_event with many excessive
- simplifications.
+ simplifications.
We should not honour --slave-skip-errors at this point as we are
- having severe errors which should not be skiped.
+ having severe errors which should not be skipped.
*/
- rli->report(ERROR_LEVEL, actual_error,
+ rli->report(ERROR_LEVEL, thd->stmt_da->sql_errno(),
"Error executing row event: '%s'",
- (actual_error ? thd->stmt_da->message() :
- "unexpected success or fatal error"));
+ thd->stmt_da->message());
thd->is_slave_error= 1;
}
- const_cast<Relay_log_info*>(rli)->slave_close_thread_tables(thd);
- DBUG_RETURN(actual_error);
+ DBUG_RETURN(1);
}
/*
diff --git a/sql/log_event_old.cc b/sql/log_event_old.cc
index 3d54ffdf7eb..55de64ce73c 100644
--- a/sql/log_event_old.cc
+++ b/sql/log_event_old.cc
@@ -1,5 +1,5 @@
-/* Copyright (c) 2007, 2018, Oracle and/or its affiliates.
- Copyright (c) 2009, 2018, MariaDB
+/* Copyright (c) 2007, 2019, Oracle and/or its affiliates.
+ Copyright (c) 2009, 2019, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -100,21 +100,20 @@ Old_rows_log_event::do_apply_event(Old_rows_log_event *ev, const Relay_log_info
if (open_and_lock_tables(ev_thd, rli->tables_to_lock, FALSE, 0))
{
- uint actual_error= ev_thd->stmt_da->sql_errno();
- if (ev_thd->is_slave_error || ev_thd->is_fatal_error)
+ if (ev_thd->is_error())
{
/*
Error reporting borrowed from Query_log_event with many excessive
- simplifications (we don't honour --slave-skip-errors)
+ simplifications.
+ We should not honour --slave-skip-errors at this point as we are
+ having severe errors which should not be skipped.
*/
- rli->report(ERROR_LEVEL, actual_error,
+ rli->report(ERROR_LEVEL, ev_thd->stmt_da->sql_errno(),
"Error '%s' on opening tables",
- (actual_error ? ev_thd->stmt_da->message() :
- "unexpected success or fatal error"));
+ ev_thd->stmt_da->message());
ev_thd->is_slave_error= 1;
}
- const_cast<Relay_log_info*>(rli)->slave_close_thread_tables(thd);
- DBUG_RETURN(actual_error);
+ DBUG_RETURN(1);
}
/*