mariadb/storage
Aleksey Midenkov 75ba5c815d MDEV-16210 FK constraints on versioned tables use historical rows, which may cause constraint violation
Constraint check is done on secondary index update.
F.ex. DELETE does row_upd_sec_index_entry() and checks constraints in
row_upd_check_references_constraints(). UPDATE is optimized for the
case when order is not changed (node->cmpl_info & UPD_NODE_NO_ORD_CHANGE)
and doesn't do row_upd_sec_index_entry(), so it doesn't check constraints.

Since for versioned DELETE we do UPDATE actually, but expect behaviour
of DELETE in terms of constraints, we should deny this optimization to
get constraints checked.

Fix wrong referenced table check when versioned DELETE inserts history in parent
table. Set check_ref to false in this case.

Removed unused dup_chk_only argument for row_ins_sec_index_entry() and
added check_ref argument.

MDEV-18057 fix was superseded by this fix and reverted.

foreign.test:
All key_type combinations: pk, unique, sec(ondary).
2019-10-10 00:20:34 +03:00
..
archive Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
blackhole Merge branch '10.2' into 10.3 2019-06-14 07:36:47 +02:00
cassandra Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
connect Merge 10.2 into 10.3 2019-10-09 13:25:11 +03:00
csv Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
example Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
federated Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
federatedx Merge 10.2 into 10.3 2019-04-04 19:41:12 +03:00
heap Merge 10.2 into 10.3 2019-08-21 15:23:45 +03:00
innobase MDEV-16210 FK constraints on versioned tables use historical rows, which may cause constraint violation 2019-10-10 00:20:34 +03:00
maria Cleanup mman.h includes 2019-10-02 20:21:30 +04:00
mroonga Merge branch '10.2' into 10.3 2019-09-03 13:17:32 +03:00
myisam Cleanup mman.h includes 2019-10-02 20:21:30 +04:00
myisammrg imporve clang build 2019-06-25 13:21:36 +03:00
oqgraph Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
perfschema Merge 10.2 into 10.3 2019-08-29 12:00:12 +03:00
rocksdb Merge 10.2 into 10.3 2019-09-23 10:25:34 +03:00
sequence MDEV-20753: Sequence with limit 0 crashes server 2019-10-09 08:55:00 +02:00
sphinx Merge remote-tracking branch 'origin/10.2' into 10.3 2019-10-01 09:37:40 +04:00
spider MDEV-19238 Mariadb spider - crashes on where null 2019-10-09 08:55:00 +02:00
test_sql_discovery Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
tokudb Merge 10.2 into 10.3 2019-09-23 10:25:34 +03:00