summaryrefslogtreecommitdiff
path: root/sql/wsrep_schema.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-09-16 20:17:12 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-09-16 20:17:12 +0300
commit03c09837fc26822ba2332d9acc3e652b8d010d4c (patch)
treee03ceb8bd6282ab144446b9f5f7fb66188b25daa /sql/wsrep_schema.cc
parentea52a3eb9795f1ae04a4f9c2be4c81e43dc86c15 (diff)
parentc430aa72abbdccb1ece7f0d65b49a6b48e7c5ba7 (diff)
downloadmariadb-git-03c09837fc26822ba2332d9acc3e652b8d010d4c.tar.gz
Merge 10.5 into 10.6
Diffstat (limited to 'sql/wsrep_schema.cc')
-rw-r--r--sql/wsrep_schema.cc17
1 files changed, 9 insertions, 8 deletions
diff --git a/sql/wsrep_schema.cc b/sql/wsrep_schema.cc
index 1bfce7874ae..9d77577ed42 100644
--- a/sql/wsrep_schema.cc
+++ b/sql/wsrep_schema.cc
@@ -270,13 +270,7 @@ static int open_table(THD* thd,
thd->lex->query_tables_own_last= 0;
if (!open_n_lock_single_table(thd, &tables, tables.lock_type, flags)) {
- if (thd->is_error()) {
- WSREP_WARN("Can't lock table %s.%s : %d (%s)",
- schema_name->str, table_name->str,
- thd->get_stmt_da()->sql_errno(), thd->get_stmt_da()->message());
- }
close_thread_tables(thd);
- my_error(ER_NO_SUCH_TABLE, MYF(0), schema_name->str, table_name->str);
DBUG_RETURN(1);
}
@@ -292,8 +286,15 @@ static int open_for_write(THD* thd, const char* table_name, TABLE** table) {
LEX_CSTRING table_str= { table_name, strlen(table_name) };
if (Wsrep_schema_impl::open_table(thd, &schema_str, &table_str, TL_WRITE,
table)) {
- WSREP_ERROR("Failed to open table %s.%s for writing",
- schema_str.str, table_name);
+ // No need to log an error 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) {
+ WSREP_ERROR("Failed to open table %s.%s for writing",
+ schema_str.str, table_name);
+ }
return 1;
}
empty_record(*table);