Skip to content

Commit

Permalink
Fix the WSREP build
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Sep 18, 2017
1 parent 3894fdd commit 4bf0879
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 25 deletions.
4 changes: 1 addition & 3 deletions mysql-test/suite/galera/r/MW-402.result
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,4 @@ f1 f2
1 2
SELECT * FROM c;
f1 p1_id p2_id f2
DROP TABLE c;
DROP TABLE p1;
DROP TABLE p2;
DROP TABLE c,p1,p2;
6 changes: 1 addition & 5 deletions mysql-test/suite/galera/t/MW-402.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_debug_sync.inc
--source suite/galera/include/galera_have_debug_sync.inc

#
Expand All @@ -19,7 +18,6 @@
CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER, f2 INTEGER,
CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1) ON DELETE CASCADE);


INSERT INTO p VALUES (1, 0);
INSERT INTO p VALUES (2, 0);
Expand Down Expand Up @@ -179,6 +177,4 @@ SELECT * FROM p1;
SELECT * FROM p2;
SELECT * FROM c;

DROP TABLE c;
DROP TABLE p1;
DROP TABLE p2;
DROP TABLE c,p1,p2;
22 changes: 5 additions & 17 deletions storage/innobase/row/row0upd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2433,17 +2433,15 @@ row_upd_sec_index_entry(
row_ins_sec_index_entry() below */
if (!rec_get_deleted_flag(
rec, dict_table_is_comp(index->table))) {

err = btr_cur_del_mark_set_sec_rec(
flags, btr_cur, TRUE, thr, &mtr);

if (err != DB_SUCCESS) {
break;
}
#ifdef WITH_WSREP
if (!referenced && foreign
wsrep_must_process_fk(node, trx) &&
!wsrep_thd_is_BF(trx->mysql_thd, FALSE)) {
&& wsrep_must_process_fk(node, trx)
&& !wsrep_thd_is_BF(trx->mysql_thd, FALSE)) {

ulint* offsets = rec_get_offsets(
rec, index, NULL, ULINT_UNDEFINED,
Expand Down Expand Up @@ -2750,13 +2748,10 @@ row_upd_clust_rec_by_insert(
goto err_exit;
}
#ifdef WITH_WSREP
} else if (foreign &&
wsrep_must_process_fk(node, trx)) {

} else if (foreign && wsrep_must_process_fk(node, trx)) {
err = wsrep_row_upd_check_foreign_constraints(
node, pcur, table, index, offsets, thr, mtr);


switch (err) {
case DB_SUCCESS:
case DB_NO_REFERENCED_ROW:
Expand All @@ -2768,16 +2763,11 @@ row_upd_clust_rec_by_insert(
<< " index " << index->name
<< " table " << index->table->name;
}
break;
goto err_exit;
default:
ib::error() << "WSREP: referenced FK check fail: " << ut_strerr(err)
<< " index " << index->name
<< " table " << index->table->name;

break;
}

if (err != DB_SUCCESS) {
goto err_exit;
}
#endif /* WITH_WSREP */
Expand Down Expand Up @@ -2994,9 +2984,7 @@ row_upd_del_mark_clust_rec(
err = row_upd_check_references_constraints(
node, pcur, index->table, index, offsets, thr, mtr);
#ifdef WITH_WSREP
} else if (trx &&
wsrep_must_process_fk(node, trx)) {

} else if (foreign && wsrep_must_process_fk(node, trx)) {
err = wsrep_row_upd_check_foreign_constraints(
node, pcur, index->table, index, offsets, thr, mtr);

Expand Down

0 comments on commit 4bf0879

Please sign in to comment.