diff options
Diffstat (limited to 'storage')
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 2 | ||||
-rw-r--r-- | 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 3df10f55893..7afc90d9709 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -9852,7 +9852,7 @@ ha_innobase::wsrep_append_keys( 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 c4cf228aa82..886a3efb5d7 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -10474,6 +10474,27 @@ wsrep_append_key( 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 @@ ha_innobase::wsrep_append_keys( /* !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( |