summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2018-10-10 13:30:56 +0300
committerJan Lindström <jan.lindstrom@mariadb.com>2018-10-10 13:30:56 +0300
commitb47a2182f68abb2044294fbb1d6925d363eb80a5 (patch)
tree77d9fc12c6b7975efcd4137a74a6cb0ed135cd7a /storage
parent508e715cb801d2d7775ee5f4d69d1ac2f68f7fee (diff)
downloadmariadb-git-b47a2182f68abb2044294fbb1d6925d363eb80a5.tar.gz
MariaDB adjustments.
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/row/row0ins.c4
-rw-r--r--storage/xtradb/row/row0ins.c26
2 files changed, 22 insertions, 8 deletions
diff --git a/storage/innobase/row/row0ins.c b/storage/innobase/row/row0ins.c
index a809a1d7d7f..5b327d11e16 100644
--- a/storage/innobase/row/row0ins.c
+++ b/storage/innobase/row/row0ins.c
@@ -1093,7 +1093,8 @@ row_ins_foreign_check_on_constraint(
foreign,
clust_rec,
clust_index,
- FALSE, WSREP_KEY_EXCLUSIVE);
+ FALSE,
+ WSREP_KEY_EXCLUSIVE);
if (err != DB_SUCCESS) {
fprintf(stderr,
"WSREP: foreign key append failed: %lu\n", err);
@@ -1451,6 +1452,7 @@ run_again:
break;
}
}
+
err = wsrep_append_foreign_key(
thr_get_trx(thr),
foreign,
diff --git a/storage/xtradb/row/row0ins.c b/storage/xtradb/row/row0ins.c
index 92103e815ae..3acdc093907 100644
--- a/storage/xtradb/row/row0ins.c
+++ b/storage/xtradb/row/row0ins.c
@@ -1095,9 +1095,7 @@ row_ins_foreign_check_on_constraint(
clust_rec,
clust_index,
FALSE,
- node != NULL
- ? WSREP_KEY_SHARED
- : WSREP_KEY_EXCLUSIVE);
+ WSREP_KEY_EXCLUSIVE);
if (err != DB_SUCCESS) {
fprintf(stderr,
"WSREP: foreign key append failed: %lu\n", err);
@@ -1444,17 +1442,31 @@ run_again:
}
if (check_ref) {
+#ifdef WITH_WSREP
+ enum wsrep_key_type key_type = WSREP_KEY_EXCLUSIVE;
+#endif /* WITH_WSREP */
err = DB_SUCCESS;
#ifdef WITH_WSREP
- err = wsrep_append_foreign_key(
+ if (upd_node != NULL) {
+ key_type = WSREP_KEY_SHARED;
+ } else {
+ switch (wsrep_certification_rules) {
+ case WSREP_CERTIFICATION_RULES_STRICT:
+ key_type = WSREP_KEY_EXCLUSIVE;
+ break;
+ case WSREP_CERTIFICATION_RULES_OPTIMIZED:
+ key_type = WSREP_KEY_SEMI;
+ break;
+ }
+ }
+
+ err = wsrep_append_foreign_key(
thr_get_trx(thr),
foreign,
rec,
check_index,
check_ref,
- upd_node != NULL
- ? WSREP_KEY_SHARED
- : WSREP_KEY_EXCLUSIVE);
+ key_type);
#endif /* WITH_WSREP */
goto end_scan;
} else if (foreign->type != 0) {