Skip to content

Commit

Permalink
MDEV-21613 : galera_sr.GCF-1018B MTR failed: Failed to open table mys…
Browse files Browse the repository at this point in the history
…ql.wsrep_streaming_log for writing

Query can be bf aborted already earlier and then we should not
even try to open table.
  • Loading branch information
Jan Lindström committed Sep 27, 2021
1 parent 83c4523 commit 690c472
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion sql/wsrep_schema.cc
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,14 @@ static int open_table(THD* thd,
NULL, lock_type);
thd->lex->query_tables_own_last= 0;

if (!open_n_lock_single_table(thd, &tables, tables.lock_type, flags)) {
// No need to open table if the query was bf aborted,
// thd client will get ER_LOCK_DEADLOCK in the end.
const bool interrupted= thd->killed ||
(thd->is_error() &&
(thd->get_stmt_da()->sql_errno() == ER_QUERY_INTERRUPTED));

if (interrupted ||
!open_n_lock_single_table(thd, &tables, tables.lock_type, flags)) {
close_thread_tables(thd);
DBUG_RETURN(1);
}
Expand Down

0 comments on commit 690c472

Please sign in to comment.