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?
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.040 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.