Bug #28190 | ON DUPLICATE KEY UPDATE updates the record even if values are identical | ||
---|---|---|---|
Submitted: | 2 May 2007 1:43 | Modified: | 25 Jul 2007 22:12 |
Reporter: | Jehan Bing | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 5.0.37,5.1BK | OS: | Linux (Fedora Core release 4 (Stentz)) |
Assigned to: | Assigned Account | CPU Architecture: | Any |
[2 May 2007 1:43]
Jehan Bing
[3 May 2007 14:41]
MySQL Verification Team
Thank you for the bug report. http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html "If you specify ON DUPLICATE KEY UPDATE, and a row is inserted that would cause a duplicate value in a UNIQUE index or PRIMARY KEY, an UPDATE of the old row is performed. For example, if column a is declared as UNIQUE and contains the value 1, the following two statements have identical effect: INSERT INTO table (a,b,c) VALUES (1,2,3) ON DUPLICATE KEY UPDATE c=c+1; UPDATE table SET c=c+1 WHERE a=1;"
[17 Jul 2007 9:19]
Evgeny Potemkin
Duplicate of the bug#29310.
[25 Jul 2007 22:12]
Jehan Bing
This bug is not a duplicate of bug 29310. Bug 29310 is about a column with "ON UPDATE" being modified when using UPDATE. It applies only to MySQL 5.1 This bug is about the column being modified when using INSERT...ON DUPLICATE KEY and applies to MySQL 5.0 and 5.1 (maybe even earlier for all I know) So while having similar symptoms, they are triggered in different ways. But I guess it's still possible that the fix for bug 29310 can also fix this one. Unfortunately, I don't have the resources to actually test that hypothesis.