Commit 396770fb authored by sjaakola's avatar sjaakola Committed by Jan Lindström

Refs: MW-369 * changed parent row key type to S(hared), when FK child table is...

Refs: MW-369 * changed parent row key type to S(hared), when FK child table is being updated or deleted
parent 7c07f456
...@@ -930,7 +930,7 @@ row_ins_invalidate_query_cache( ...@@ -930,7 +930,7 @@ row_ins_invalidate_query_cache(
mem_free(buf); mem_free(buf);
} }
#ifdef WITH_WSREP #ifdef WITH_WSREP
dberr_t wsrep_append_foreign_key(trx_t *trx, dberr_t wsrep_append_foreign_key(trx_t *trx,
dict_foreign_t* foreign, dict_foreign_t* foreign,
const rec_t* clust_rec, const rec_t* clust_rec,
dict_index_t* clust_index, dict_index_t* clust_index,
...@@ -1294,7 +1294,8 @@ row_ins_foreign_check_on_constraint( ...@@ -1294,7 +1294,8 @@ row_ins_foreign_check_on_constraint(
foreign, foreign,
clust_rec, clust_rec,
clust_index, clust_index,
FALSE, FALSE); FALSE,
(node) ? TRUE : FALSE);
if (err != DB_SUCCESS) { if (err != DB_SUCCESS) {
fprintf(stderr, fprintf(stderr,
"WSREP: foreign key append failed: %d\n", err); "WSREP: foreign key append failed: %d\n", err);
...@@ -1455,6 +1456,9 @@ row_ins_check_foreign_constraint( ...@@ -1455,6 +1456,9 @@ row_ins_check_foreign_constraint(
ulint* offsets = offsets_; ulint* offsets = offsets_;
rec_offs_init(offsets_); rec_offs_init(offsets_);
#ifdef WITH_WSREP
upd_node= NULL;
#endif /* WITH_WSREP */
run_again: run_again:
#ifdef UNIV_SYNC_DEBUG #ifdef UNIV_SYNC_DEBUG
ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_SHARED)); ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_SHARED));
...@@ -1638,9 +1642,10 @@ row_ins_check_foreign_constraint( ...@@ -1638,9 +1642,10 @@ row_ins_check_foreign_constraint(
err = wsrep_append_foreign_key( err = wsrep_append_foreign_key(
thr_get_trx(thr), thr_get_trx(thr),
foreign, foreign,
rec, rec,
check_index, check_index,
check_ref, FALSE); check_ref,
(upd_node) ? TRUE : FALSE);
#endif /* WITH_WSREP */ #endif /* WITH_WSREP */
goto end_scan; goto end_scan;
} else if (foreign->type != 0) { } else if (foreign->type != 0) {
......
...@@ -936,7 +936,7 @@ row_ins_invalidate_query_cache( ...@@ -936,7 +936,7 @@ row_ins_invalidate_query_cache(
mem_free(buf); mem_free(buf);
} }
#ifdef WITH_WSREP #ifdef WITH_WSREP
dberr_t wsrep_append_foreign_key(trx_t *trx, dberr_t wsrep_append_foreign_key(trx_t *trx,
dict_foreign_t* foreign, dict_foreign_t* foreign,
const rec_t* clust_rec, const rec_t* clust_rec,
dict_index_t* clust_index, dict_index_t* clust_index,
...@@ -1300,7 +1300,8 @@ row_ins_foreign_check_on_constraint( ...@@ -1300,7 +1300,8 @@ row_ins_foreign_check_on_constraint(
foreign, foreign,
clust_rec, clust_rec,
clust_index, clust_index,
FALSE, FALSE); FALSE,
(node) ? TRUE : FALSE);
if (err != DB_SUCCESS) { if (err != DB_SUCCESS) {
fprintf(stderr, fprintf(stderr,
"WSREP: foreign key append failed: %d\n", err); "WSREP: foreign key append failed: %d\n", err);
...@@ -1461,6 +1462,9 @@ row_ins_check_foreign_constraint( ...@@ -1461,6 +1462,9 @@ row_ins_check_foreign_constraint(
ulint* offsets = offsets_; ulint* offsets = offsets_;
rec_offs_init(offsets_); rec_offs_init(offsets_);
#ifdef WITH_WSREP
upd_node= NULL;
#endif /* WITH_WSREP */
run_again: run_again:
#ifdef UNIV_SYNC_DEBUG #ifdef UNIV_SYNC_DEBUG
ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_SHARED)); ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_SHARED));
...@@ -1650,9 +1654,10 @@ row_ins_check_foreign_constraint( ...@@ -1650,9 +1654,10 @@ row_ins_check_foreign_constraint(
err = wsrep_append_foreign_key( err = wsrep_append_foreign_key(
thr_get_trx(thr), thr_get_trx(thr),
foreign, foreign,
rec, rec,
check_index, check_index,
check_ref, FALSE); check_ref,
(upd_node) ? TRUE : FALSE);
#endif /* WITH_WSREP */ #endif /* WITH_WSREP */
goto end_scan; goto end_scan;
} else if (foreign->type != 0) { } else if (foreign->type != 0) {
......
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