summaryrefslogtreecommitdiff
path: root/sql/wsrep_mysqld.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2021-02-23 13:01:27 +0100
committerSergei Golubchik <serg@mariadb.org>2021-02-23 13:06:22 +0100
commitf33e57a9e66f7e1790cb84b141381bb668e281a0 (patch)
tree31bb1c5bd8e0addc9e994a1bb42b4703c37f7ed8 /sql/wsrep_mysqld.cc
parent1a0526e2f294acdcac829672794ee1fe708eb2b3 (diff)
parent245d33db4e0586df4fe28362fb002cef0151a1c9 (diff)
downloadmariadb-git-f33e57a9e66f7e1790cb84b141381bb668e281a0.tar.gz
Merge branch '10.4' into 10.5
Diffstat (limited to 'sql/wsrep_mysqld.cc')
-rw-r--r--sql/wsrep_mysqld.cc17
1 files changed, 15 insertions, 2 deletions
diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc
index aa6a7a2ca63..f14bf06800a 100644
--- a/sql/wsrep_mysqld.cc
+++ b/sql/wsrep_mysqld.cc
@@ -1261,10 +1261,17 @@ void wsrep_keys_free(wsrep_key_arr_t* key_arr)
key_arr->keys_len= 0;
}
-void
+/*!
+ * @param thd thread
+ * @param tables list of tables
+ * @param keys prepared keys
+
+ * @return true if parent table append was successfull, otherwise false.
+*/
+bool
wsrep_append_fk_parent_table(THD* thd, TABLE_LIST* tables, wsrep::key_array* keys)
{
- if (!WSREP(thd) || !WSREP_CLIENT(thd)) return;
+ bool fail= false;
TABLE_LIST *table;
thd->release_transactional_locks();
@@ -1275,6 +1282,8 @@ wsrep_append_fk_parent_table(THD* thd, TABLE_LIST* tables, wsrep::key_array* key
open_tables(thd, &tables, &counter, MYSQL_OPEN_FORCE_SHARED_HIGH_PRIO_MDL))
{
WSREP_DEBUG("unable to open table for FK checks for %s", thd->query());
+ fail= true;
+ goto exit;
}
for (table= tables; table; table= table->next_local)
@@ -1296,14 +1305,18 @@ wsrep_append_fk_parent_table(THD* thd, TABLE_LIST* tables, wsrep::key_array* key
}
}
+exit:
/* close the table and release MDL locks */
close_thread_tables(thd);
thd->mdl_context.rollback_to_savepoint(mdl_savepoint);
for (table= tables; table; table= table->next_local)
{
table->table= NULL;
+ table->next_global= NULL;
table->mdl_request.ticket= NULL;
}
+
+ return fail;
}
/*!