summaryrefslogtreecommitdiff
path: root/sql/wsrep_schema.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-09-30 10:38:44 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-09-30 10:38:44 +0300
commita49e394399859b23ba609d0058b498cfa876cac4 (patch)
treed0f1a85011d7e99078624c2185a9ba69796a4262 /sql/wsrep_schema.cc
parent260649de0472e90be665ae2c442c4435e125b022 (diff)
parentbe803f037f98812410f24b67af61aa7857969dcf (diff)
downloadmariadb-git-a49e394399859b23ba609d0058b498cfa876cac4.tar.gz
Merge 10.5 into 10.6
Diffstat (limited to 'sql/wsrep_schema.cc')
-rw-r--r--sql/wsrep_schema.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/sql/wsrep_schema.cc b/sql/wsrep_schema.cc
index cc8ec7a5af4..48077040f88 100644
--- a/sql/wsrep_schema.cc
+++ b/sql/wsrep_schema.cc
@@ -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);
}