[Commits] 2399f1a: Fix for build failure.

Nirbhay Choubey nirbhay at mariadb.com
Thu Nov 5 04:56:47 EET 2015


revision-id: 2399f1aee77d9f9558f4d65979448d44a98f8879
parent(s): 4d1511296288782df0e3d9373396724e250b24c1
committer: Nirbhay Choubey
branch nick: 10.0-galera
timestamp: 2015-11-04 21:56:46 -0500
message:

Fix for build failure.

---
 storage/innobase/handler/ha_innodb.cc |  2 +-
 storage/xtradb/handler/ha_innodb.cc   | 23 ++++++++++++++++++++++-
 2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 3df10f5..7afc90d 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -9852,7 +9852,7 @@ once the search result (Doc IDs) is available */
 		ibool    is_null;
 
 		len = wsrep_store_key_val_for_row(
-			thd, table, 0, key, WSREP_MAX_SUPPORTED_KEY_LENGTH, 
+			thd, table, 0, key, WSREP_MAX_SUPPORTED_KEY_LENGTH,
 			record0, &is_null);
 
 		if (!is_null) {
diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc
index c4cf228..886a3ef 100644
--- a/storage/xtradb/handler/ha_innodb.cc
+++ b/storage/xtradb/handler/ha_innodb.cc
@@ -10474,6 +10474,27 @@ once the search result (Doc IDs) is available */
 extern void compute_md5_hash(char *digest, const char *buf, int len);
 #define MD5_HASH compute_md5_hash
 
+static bool
+referenced_by_foreign_key2(dict_table_t* table,
+	                   dict_index_t* index) {
+	ut_ad(table != NULL);
+	ut_ad(index != NULL);
+
+	const dict_foreign_set* fks = &table->referenced_set;
+	for (dict_foreign_set::const_iterator it = fks->begin();
+	     it != fks->end();
+	     ++it)
+	{
+		dict_foreign_t* foreign = *it;
+		if (foreign->referenced_index != index) {
+			continue;
+		}
+		ut_ad(table == foreign->referenced_table);
+		return true;
+	}
+	return false;
+}
+
 int
 ha_innobase::wsrep_append_keys(
 /*==================*/
@@ -10553,7 +10574,7 @@ once the search result (Doc IDs) is available */
 			/* !hasPK == table with no PK, must append all non-unique keys */
 			if (!hasPK || key_info->flags & HA_NOSAME ||
 			    ((tab &&
-			      dict_table_get_referenced_constraint(tab, idx)) ||
+			      referenced_by_foreign_key2(tab, idx)) ||
 			     (!tab && referenced_by_foreign_key()))) {
 
 				len = wsrep_store_key_val_for_row(


More information about the commits mailing list