| Bug #13977 | InnoDB foreign keys with multiple parent rows act incorrectly | ||
|---|---|---|---|
| Submitted: | 12 Oct 2005 22:00 | ||
| Reporter: | Ian Gulliver | ||
| Status: | Open | ||
| Category: | Server: InnoDB | Severity: | S4 (Feature request) |
| Version: | 5.0.13 | OS: | Linux (Debian Sarge) |
| Assigned to: | Heikki Tuuri | Target Version: | |
| Triage: | D5 (Feature request) | ||
[12 Oct 2005 22:00]
Ian Gulliver
[12 Sep 2006 3:16]
Peter Thomassen
I'm currently having the same problem, using CASCADE. I've written an invoicing application that handles invoices and reminders the same way, only differing in their level (invoice = 0, first reminder = 1, second = 2). In two cases, I accidentally created a reminder that I deleted afterwards. To my very surprise, the invoice items referencing the invoice number were gone because the reminder row was another parent row with the same number. I was angry and looked for my backup. The behavior I intended is that invoice items are only to be deleted when all reminders and invoices are deleted, i.e. when there isn't another parent row. Especially if the current behavior deviates from SQL, this should be fixed (and would, sometimes, simplify life a lot). Thank you.
[15 Feb 19:59]
Peter Gulutzan
For WL#149 (Foreign keys all storage engines) the decision was: allowing multiple parent rows will be illegal if one starts the server with --foreign-key-all-engines=1.
