ON DUPLICATE KEY UPDATE causes foreign key errors to be reported as duplicate entry error
Bug #1586122 reported by
Justin Gronfur
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
MySQL Server |
Unknown
|
Unknown
|
||||
Percona Server moved to https://jira.percona.com/projects/PS | Status tracked in 5.7 | |||||
5.5 |
Fix Released
|
Undecided
|
Unassigned | |||
5.6 |
Fix Released
|
Undecided
|
Unassigned | |||
5.7 |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
I recently updated a system to Percona Server 5.6.30-76.3 and had some code that relied on the incorrect behavior fixed by http://
While updating that code to use INSERT ... ON DUPLICATE KEY UPDATE instead of INSERT IGNORE I noticed that foreign key constraint failures (ERROR 1452) are being incorrectly returned as duplicate entry (ERROR 1062) when an ON DUPLICATE KEY UPDATE clause is present. Please see the attached bug.txt that walks through a simple reproduction of the bug.
The seems to have been introduced in 5.6.30-76.3 as I have not be able to reproduce it in any other version.
tags: | added: upstream |
To post a comment you must log in.
Marking this as "Fix Released" as it was fixed in the upstream MySQL 5.6.31 (http:// dev.mysql. com/doc/ relnotes/ mysql/5. 6/en/news- 5-6-31. html)