Commit ae1b8b9b authored by Venkatesh Venugopal's avatar Venkatesh Venugopal Committed by Sergei Golubchik

Problem

```----
MySQL abnormally exits on KILL command.

Fix
```

The abnormal exit has been fixed.

RB: 20971, 21129, 21237
parent 2be3ab97
/* /*
Copyright (c) 2000, 2018, Oracle and/or its affiliates. Copyright (c) 2000, 2019, Oracle and/or its affiliates.
Copyright (c) 2009, 2018, MariaDB Copyright (c) 2009, 2019, MariaDB
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
#include "transaction.h" #include "transaction.h"
#include <my_dir.h> #include <my_dir.h>
#include "sql_show.h" // append_identifier #include "sql_show.h" // append_identifier
#include "debug_sync.h" // debug_sync
#endif /* MYSQL_CLIENT */ #endif /* MYSQL_CLIENT */
...@@ -8512,25 +8513,28 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli) ...@@ -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 */ /* A small test to verify that objects have consistent types */
DBUG_ASSERT(sizeof(thd->variables.option_bits) == sizeof(OPTION_RELAXED_UNIQUE_CHECKS)); 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)) if (open_and_lock_tables(thd, rli->tables_to_lock, FALSE, 0))
{ {
uint actual_error= thd->stmt_da->sql_errno(); if (thd->is_error())
if (thd->is_slave_error || thd->is_fatal_error)
{ {
/* /*
Error reporting borrowed from Query_log_event with many excessive 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 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'", "Error executing row event: '%s'",
(actual_error ? thd->stmt_da->message() : thd->stmt_da->message());
"unexpected success or fatal error"));
thd->is_slave_error= 1; thd->is_slave_error= 1;
} }
const_cast<Relay_log_info*>(rli)->slave_close_thread_tables(thd); DBUG_RETURN(1);
DBUG_RETURN(actual_error);
} }
/* /*
......
/* Copyright (c) 2007, 2018, Oracle and/or its affiliates. /* Copyright (c) 2007, 2019, Oracle and/or its affiliates.
Copyright (c) 2009, 2018, MariaDB Copyright (c) 2009, 2019, MariaDB
This program is free software; you can redistribute it and/or modify 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 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 ...@@ -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)) 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_error())
if (ev_thd->is_slave_error || ev_thd->is_fatal_error)
{ {
/* /*
Error reporting borrowed from Query_log_event with many excessive 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", "Error '%s' on opening tables",
(actual_error ? ev_thd->stmt_da->message() : ev_thd->stmt_da->message());
"unexpected success or fatal error"));
ev_thd->is_slave_error= 1; ev_thd->is_slave_error= 1;
} }
const_cast<Relay_log_info*>(rli)->slave_close_thread_tables(thd); DBUG_RETURN(1);
DBUG_RETURN(actual_error);
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment