mariadb/storage/innobase/row
Aleksey Midenkov 7ae0be25a6 MDEV-20812 Unexpected ER_ROW_IS_REFERENCED_2 upon DELETE from versioned table with FK
MDEV-16210 original case was wrongly allowed versioned DELETE from
referenced table where reference is by non-primary key. InnoDB UPDATE
has optimization for new rows not changing its clustered index
position. In this case InnoDB doesn't update all secondary indexes and
misses the one holding the referenced key. The fix was to disable this
optimization for versioned DELETE. In case of versioned DELETE we
forcely update all secondary indexes and therefore check them for
constraints.

But the above fix raised another problem with versioned DELETE on
foreign table side. In case when there was no corresponding record in
referenced table (illegal foreign reference can be done with "set
foreign_key_checks=off") there was spurious constraint check (because
versioned DELETE is actually UPDATE) and hence the operation failed
with constraint error.

MDEV-16210 tried to fix the above problem by checking foreign table
instead of referenced table and that at least was illegal.

Constraint check is done by row_ins_check_foreign_constraint() no
matter what kind of table is checked, referenced or foreign
(controlled by check_ref argument).

Referenced table is checked by row_upd_check_references_constraints().
Foreign table is checked by row_ins_check_foreign_constraints().

Current fix rolls back the wrong fix for the above problem and
disables referenced table check for DELETE on foreign side by
introducing `check_foreign` argument which when set to *false* skips
row_ins_check_foreign_constraints() call.
2019-10-15 13:29:18 +03:00
..
row0ext.cc Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
row0ftsort.cc MDEV-19974 InnoDB: Cannot load compressed BLOB 2019-07-10 13:21:40 +05:30
row0import.cc Merge 10.2 into 10.3 2019-10-10 20:38:44 +03:00
row0ins.cc MDEV-20812 Unexpected ER_ROW_IS_REFERENCED_2 upon DELETE from versioned table with FK 2019-10-15 13:29:18 +03:00
row0log.cc Merge 10.2 into 10.3 2019-09-23 10:25:34 +03:00
row0merge.cc Merge 10.2 into 10.3 2019-07-25 15:31:11 +03:00
row0mysql.cc Merge 10.2 into 10.3 2019-09-27 15:56:15 +03:00
row0purge.cc Merge 10.2 into 10.3 2019-10-12 06:34:09 +03:00
row0quiesce.cc Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
row0row.cc Merge branch '10.2' into 10.3 2019-06-14 07:36:47 +02:00
row0sel.cc MDEV-15326: Backport trx_t::is_referenced() 2019-09-04 09:42:38 +03:00
row0trunc.cc Merge 10.2 into 10.3 2019-10-10 20:38:44 +03:00
row0uins.cc MDEV-20425: Fix -Wimplicit-fallthrough 2019-08-30 14:11:59 +03:00
row0umod.cc row_undo_mod_remove_clust_low(): Remove duplicated code 2019-08-22 17:37:13 +03:00
row0undo.cc Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
row0upd.cc MDEV-20812 Unexpected ER_ROW_IS_REFERENCED_2 upon DELETE from versioned table with FK 2019-10-15 13:29:18 +03:00
row0vers.cc Merge 10.2 into 10.3 2019-10-12 06:34:09 +03:00