Bug #78854 "more than one unique or primary key"
Submitted: 16 Oct 2015 1:21 Modified: 27 Oct 2015 3:28
Reporter: monty solomon Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.6, 5.7 OS:Any
Assigned to: CPU Architecture:Any

[16 Oct 2015 1:21] monty solomon
Description:
The documentation for INSERT ... ON DUPLICATE KEY UPDATE states, in part, 

"In addition, beginning with MySQL 5.6.6, an INSERT ... ON DUPLICATE KEY UPDATE statement against a table having more than one unique or primary key is also marked as unsafe"

but it is not possible to have more than one primary key.

How to repeat:
View the documentation

https://dev.mysql.com/doc/refman/5.6/en/insert-on-duplicate.html

https://dev.mysql.com/doc/refman/5.7/en/insert-on-duplicate.html

Suggested fix:
Improve the wording.

The documentation previously uses the wording "multiple unique indexes" 

"In general, you should try to avoid using an ON DUPLICATE KEY UPDATE clause on tables with multiple unique indexes."
[16 Oct 2015 6:53] MySQL Verification Team
Hello monty solomon,

Thank you for the report.

Thanks,
Umesh
[27 Oct 2015 3:28] Jon Stephens
It is perfectly possible for a table to have more than one key which is a primary *or* unique key. And multiple primary keys are impossible by definition.

So, not a bug.