New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Foreign Key with ON DELETE CASCADE ignored [CORE3068] #3447
Comments
Commented by: Alex Poloziouk (poloziouk) Backup |
Modified by: Alex Poloziouk (poloziouk)Attachment: Test.zip [ 11681 ] |
Modified by: Alex Poloziouk (poloziouk)description: Please see attached database backup. Two tables DMG (master) and TRNS (child) linked via foreign key with ON DELETE CASCADE. For some reason when I try to delete records from DMG (delete from dmg where dmg_id=1) I get following error: This is how FK looks like: If I re-create FK all works. Looking at metadata I can not find any issues. We have several databases (most of them around 5-6GB) with this issue and re-creation of FK is not a solution. Thank you, => Please see attached database backup. Two tables DMG (master) and TRNS (child) linked via foreign key with ON DELETE CASCADE. For some reason when I try to delete records from DMG (delete from dmg where dmg_id=1) I get following error: This is how FK looks like: ALTER TABLE TRNS ADD CONSTRAINT FK_TRNS FOREIGN KEY (DMG_ID) REFERENCES DMG (DMG_ID) ON DELETE CASCADE USING INDEX IX_FK_TRNS; If I re-create FK all works. Looking at metadata I can not find any issues. We have several databases (most of them around 5-6GB) with this issue and re-creation of FK is not a solution. Thank you, |
Modified by: Alex Poloziouk (poloziouk)security: Developers [ 10012 ] => |
Commented by: @hvlad Your database have no system trigger on TRANS for FK_TRNS. I see nothing to fix there |
Commented by: Alex Poloziouk (apoloziouk) Vlad, Thank you for fast response. Please close this ticket. Best regards, |
Modified by: @pcisarstatus: Resolved [ 5 ] => Closed [ 6 ] |
Submitted by: Alex Poloziouk (poloziouk)
Attachments:
Test.zip
Please see attached database backup.
Two tables DMG (master) and TRNS (child) linked via foreign key with ON DELETE CASCADE.
For some reason when I try to delete records from DMG (delete from dmg where dmg_id=1) I get following error:
violation of FOREIGN KEY constraint "FK_TRNS" on table "TRNS".
Foreign key references are present for the record.
This is how FK looks like:
ALTER TABLE TRNS ADD CONSTRAINT FK_TRNS FOREIGN KEY (DMG_ID) REFERENCES DMG (DMG_ID) ON DELETE CASCADE USING INDEX IX_FK_TRNS;
If I re-create FK all works.
Backup/restore does not help.
Looking at metadata I can not find any issues.
We have several databases (most of them around 5-6GB) with this issue and re-creation of FK is not a solution.
Thank you,
Alex Poloziouk
The text was updated successfully, but these errors were encountered: