ON DUPLICATE KEY UPDATE causes foreign key errors to be reported as duplicate entry error

Bug #1586122 reported by Justin Gronfur
10
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://bugs.mysql.com/bug.php?id=78853

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: upstream
Revision history for this message
Justin Gronfur (justin-gronfur) wrote :
summary: ON DUPLICATE KEY UPDATE causes foreign key errors to be reported as
- duplicate key entry error
+ duplicate entry error
description: updated
Revision history for this message
Justin Gronfur (justin-gronfur) wrote :

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)

Changed in percona-server:
status: New → Fix Released
tags: added: upstream
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-3448

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.