Skip to content

Commit 2399f1a

Browse files
author
Nirbhay Choubey
committed
Fix for build failure.
1 parent 4d15112 commit 2399f1a

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

storage/innobase/handler/ha_innodb.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9852,7 +9852,7 @@ ha_innobase::wsrep_append_keys(
98529852
ibool is_null;
98539853

98549854
len = wsrep_store_key_val_for_row(
9855-
thd, table, 0, key, WSREP_MAX_SUPPORTED_KEY_LENGTH,
9855+
thd, table, 0, key, WSREP_MAX_SUPPORTED_KEY_LENGTH,
98569856
record0, &is_null);
98579857

98589858
if (!is_null) {

storage/xtradb/handler/ha_innodb.cc

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10474,6 +10474,27 @@ wsrep_append_key(
1047410474
extern void compute_md5_hash(char *digest, const char *buf, int len);
1047510475
#define MD5_HASH compute_md5_hash
1047610476

10477+
static bool
10478+
referenced_by_foreign_key2(dict_table_t* table,
10479+
dict_index_t* index) {
10480+
ut_ad(table != NULL);
10481+
ut_ad(index != NULL);
10482+
10483+
const dict_foreign_set* fks = &table->referenced_set;
10484+
for (dict_foreign_set::const_iterator it = fks->begin();
10485+
it != fks->end();
10486+
++it)
10487+
{
10488+
dict_foreign_t* foreign = *it;
10489+
if (foreign->referenced_index != index) {
10490+
continue;
10491+
}
10492+
ut_ad(table == foreign->referenced_table);
10493+
return true;
10494+
}
10495+
return false;
10496+
}
10497+
1047710498
int
1047810499
ha_innobase::wsrep_append_keys(
1047910500
/*==================*/
@@ -10553,7 +10574,7 @@ ha_innobase::wsrep_append_keys(
1055310574
/* !hasPK == table with no PK, must append all non-unique keys */
1055410575
if (!hasPK || key_info->flags & HA_NOSAME ||
1055510576
((tab &&
10556-
dict_table_get_referenced_constraint(tab, idx)) ||
10577+
referenced_by_foreign_key2(tab, idx)) ||
1055710578
(!tab && referenced_by_foreign_key()))) {
1055810579

1055910580
len = wsrep_store_key_val_for_row(

0 commit comments

Comments
 (0)