[MDEV-30674] Implement CHECK constraints validation on cascading updates Created: 2023-02-17  Updated: 2023-11-05  Resolved: 2023-11-05

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Create Table, Storage Engine - InnoDB
Fix Version/s: N/A

Type: Task Priority: Major
Reporter: Valerii Kravchuk Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: check, check_constraints

Issue Links:
Blocks
is blocked by MDEV-12302 Execute triggers for foreign key upda... Confirmed
Duplicate
duplicates MDEV-22880 Honor constraints on UPDATE CASCADE Open
Relates
relates to MDEV-18114 Foreign Key Constraint actions don't ... Closed
relates to MDEV-22602 WITHOUT OVERLAPS constraint is ignore... Closed
relates to MDEV-29181 Potential corruption on Foreign key u... In Review
relates to MDEV-30606 Foreign key cannot be used in the che... Closed

 Description   

If a field is a part of a foreign key with a ON UPDATE CASCADE action, it can be updated internally by InnoDB without informing the server and without validating the CHECK constraint. In other words, such cascading updates can invalidate the constraint and that's why they are not supported since MDEV-30606.

It was stated that It's possible to implement CHECK constraint validation on cascading updates, hence this task to do this in version 11.1+ at least.



 Comments   
Comment by Marko Mäkelä [ 2023-02-17 ]

I believe that this could be fixed as a consequence of fixing MDEV-12302.

Comment by Sergei Golubchik [ 2023-03-03 ]

marko, yes, that's exactly what I meant. CHECK constraints, long uniques, unique constraints WITHOUT OVERLAP, system versioning — this will all be possible after MDEV-12302. I suppose InnoDB handles generated columns (stored and indexed virtual) internally already.

Comment by Michael Widenius [ 2023-11-05 ]

MDEV-12302 was created 6 years ago. We have to re-prioritize this one and fix this.
This is not hard to do.
At the same time we should also ensure, it not already done, that all generated stored columns are updated as part of foreign key updates.

Generated at Thu Feb 08 10:18:03 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.