3616
MariaDBWARNINGNotableDDLHIGH confidence
Trigger is incompatible with the foreign key constraint
Production Risk
High — Unexpected cascade behavior or trigger failures may silently corrupt referential integrity.
How to reproduce
trigger — this will error
trigger — this will error
CREATE TRIGGER trg AFTER DELETE ON parent FOR EACH ROW BEGIN /* logic */ END;
expected output
Warning 3616: Trigger is incompatible with the foreign key constraint.
Fix
Align trigger and FK cascade actions
Align trigger and FK cascade actions
-- Review trigger and FK; remove the trigger or change FK ON DELETE to NO ACTION
Why this works
Eliminates the cascade/trigger conflict by using compatible constraint actions.
What not to do
✕
Version notes
Sources
Official documentation ↗
MySQL 8.0 — 3616 ER_WARN_FK_TRIGGER_INCOMPATIBLE_WITH_FK
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev