Commit c1e1764f authored by Marko Mäkelä's avatar Marko Mäkelä

Fix embedded innodb_plugin after 560799eb

wsrep_certification_rules: Define as a weak global symbol.
While there are separate _embedded.a for statically
linked storage engine plugins, there is only one ha_innodb.so
which is supposed to work with both values of WITH_WSREP.

The merge from 10.0-galera introduced a reference to a global
variable that is only defined when the server is built WITH_WSREP.
We must define that symbol as weak global, so that when
a dynamically linked InnoDB or XtraDB is used with the embedded
server (which never includes write-set replication patches),
the variable will be read as 0, instead of causing a failure to
load the InnoDB or XtraDB plugin.
parent a193c572
...@@ -21,6 +21,10 @@ enum enum_wsrep_certification_rules { ...@@ -21,6 +21,10 @@ enum enum_wsrep_certification_rules {
WSREP_CERTIFICATION_RULES_OPTIMIZED 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 */ #endif /* WSREP_MYSQLD_C_H */
...@@ -56,6 +56,7 @@ Created 4/20/1996 Heikki Tuuri ...@@ -56,6 +56,7 @@ Created 4/20/1996 Heikki Tuuri
#include "m_string.h" #include "m_string.h"
#ifdef WITH_WSREP #ifdef WITH_WSREP
#include <mysql/service_wsrep.h>
#include "../../../wsrep/wsrep_api.h" #include "../../../wsrep/wsrep_api.h"
#include "wsrep_mysqld_c.h" #include "wsrep_mysqld_c.h"
#endif /* WITH_WSREP */ #endif /* WITH_WSREP */
...@@ -1645,6 +1646,9 @@ row_ins_check_foreign_constraint( ...@@ -1645,6 +1646,9 @@ row_ins_check_foreign_constraint(
if (check_ref) { if (check_ref) {
err = DB_SUCCESS; err = DB_SUCCESS;
#ifdef WITH_WSREP #ifdef WITH_WSREP
if (!wsrep_on(trx->mysql_thd)) {
goto end_scan;
}
enum wsrep_key_type key_type; enum wsrep_key_type key_type;
if (upd_node != NULL) { if (upd_node != NULL) {
key_type = WSREP_KEY_SHARED; key_type = WSREP_KEY_SHARED;
...@@ -1661,7 +1665,7 @@ row_ins_check_foreign_constraint( ...@@ -1661,7 +1665,7 @@ row_ins_check_foreign_constraint(
} }
err = wsrep_append_foreign_key( err = wsrep_append_foreign_key(
thr_get_trx(thr), trx,
foreign, foreign,
rec, rec,
check_index, check_index,
......
...@@ -56,6 +56,7 @@ Created 4/20/1996 Heikki Tuuri ...@@ -56,6 +56,7 @@ Created 4/20/1996 Heikki Tuuri
#include "m_string.h" #include "m_string.h"
#ifdef WITH_WSREP #ifdef WITH_WSREP
#include <mysql/service_wsrep.h>
#include "../../../wsrep/wsrep_api.h" #include "../../../wsrep/wsrep_api.h"
#include "wsrep_mysqld_c.h" #include "wsrep_mysqld_c.h"
#endif /* WITH_WSREP */ #endif /* WITH_WSREP */
...@@ -1657,6 +1658,9 @@ row_ins_check_foreign_constraint( ...@@ -1657,6 +1658,9 @@ row_ins_check_foreign_constraint(
if (check_ref) { if (check_ref) {
err = DB_SUCCESS; err = DB_SUCCESS;
#ifdef WITH_WSREP #ifdef WITH_WSREP
if (!wsrep_on(trx->mysql_thd)) {
goto end_scan;
}
enum wsrep_key_type key_type; enum wsrep_key_type key_type;
if (upd_node != NULL) { if (upd_node != NULL) {
key_type = WSREP_KEY_SHARED; key_type = WSREP_KEY_SHARED;
...@@ -1673,7 +1677,7 @@ row_ins_check_foreign_constraint( ...@@ -1673,7 +1677,7 @@ row_ins_check_foreign_constraint(
} }
err = wsrep_append_foreign_key( err = wsrep_append_foreign_key(
thr_get_trx(thr), trx,
foreign, foreign,
rec, rec,
check_index, check_index,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment