summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/wsrep_mysqld_c.h6
-rw-r--r--storage/innobase/row/row0ins.cc6
-rw-r--r--storage/xtradb/row/row0ins.cc6
3 files changed, 15 insertions, 3 deletions
diff --git a/sql/wsrep_mysqld_c.h b/sql/wsrep_mysqld_c.h
index 15ca0ae2a6d..235a871c113 100644
--- a/sql/wsrep_mysqld_c.h
+++ b/sql/wsrep_mysqld_c.h
@@ -21,6 +21,10 @@ enum enum_wsrep_certification_rules {
WSREP_CERTIFICATION_RULES_OPTIMIZED
};
-extern ulong wsrep_certification_rules;
+/* This is intentionally declared as a weak global symbol, so that
+the same ha_innodb.so can be used with the embedded server
+(which does not link to the definition of this variable)
+and with the regular server built WITH_WSREP. */
+extern ulong wsrep_certification_rules __attribute__((weak));
#endif /* WSREP_MYSQLD_C_H */
diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc
index 22588d33418..65a27ebeb37 100644
--- a/storage/innobase/row/row0ins.cc
+++ b/storage/innobase/row/row0ins.cc
@@ -56,6 +56,7 @@ Created 4/20/1996 Heikki Tuuri
#include "m_string.h"
#ifdef WITH_WSREP
+#include <mysql/service_wsrep.h>
#include "../../../wsrep/wsrep_api.h"
#include "wsrep_mysqld_c.h"
#endif /* WITH_WSREP */
@@ -1645,6 +1646,9 @@ run_again:
if (check_ref) {
err = DB_SUCCESS;
#ifdef WITH_WSREP
+ if (!wsrep_on(trx->mysql_thd)) {
+ goto end_scan;
+ }
enum wsrep_key_type key_type;
if (upd_node != NULL) {
key_type = WSREP_KEY_SHARED;
@@ -1661,7 +1665,7 @@ run_again:
}
err = wsrep_append_foreign_key(
- thr_get_trx(thr),
+ trx,
foreign,
rec,
check_index,
diff --git a/storage/xtradb/row/row0ins.cc b/storage/xtradb/row/row0ins.cc
index b14d43e4f42..476c18680f3 100644
--- a/storage/xtradb/row/row0ins.cc
+++ b/storage/xtradb/row/row0ins.cc
@@ -56,6 +56,7 @@ Created 4/20/1996 Heikki Tuuri
#include "m_string.h"
#ifdef WITH_WSREP
+#include <mysql/service_wsrep.h>
#include "../../../wsrep/wsrep_api.h"
#include "wsrep_mysqld_c.h"
#endif /* WITH_WSREP */
@@ -1657,6 +1658,9 @@ run_again:
if (check_ref) {
err = DB_SUCCESS;
#ifdef WITH_WSREP
+ if (!wsrep_on(trx->mysql_thd)) {
+ goto end_scan;
+ }
enum wsrep_key_type key_type;
if (upd_node != NULL) {
key_type = WSREP_KEY_SHARED;
@@ -1673,7 +1677,7 @@ run_again:
}
err = wsrep_append_foreign_key(
- thr_get_trx(thr),
+ trx,
foreign,
rec,
check_index,