Bug #7412 | Cannot delete a row that references itself. | ||
---|---|---|---|
Submitted: | 18 Dec 2004 19:29 | Modified: | 18 Dec 2004 23:08 |
Reporter: | Sergey Koshcheyev | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S4 (Feature request) |
Version: | 4.1.8 | OS: | Windows (Windows XP SP2) |
Assigned to: | Assigned Account | CPU Architecture: | Any |
[18 Dec 2004 19:29]
Sergey Koshcheyev
[18 Dec 2004 23:08]
Heikki Tuuri
Hi! I am changing this to a feature request. This is a special case where deferred constraints would be needed. Workaround: SET FOREIGN_KEY_CHECKS=0; temporarily. Regards, Heikki
[30 Apr 2007 6:24]
Bhavin Thakkar
Just write as below and it should solve the problem: CONSTRAINT `ref_id` FOREIGN KEY (`ref_id`) REFERENCES `tbl` (`id`) ON DELETE CASCADE. ON DELETE CASCADE WILL SOLVE YOUR PROBLEM. Cheers, Bhavin
[1 Oct 2009 22:53]
Peter Gulutzan
Bug#15746 was marked as a duplicate of this one.
[19 Nov 2011 18:02]
Andras Gyomrey
Any chance this feature will be added in a close future?