Bug #69450 | Unnecessary replication warning messages in error logs | ||
---|---|---|---|
Submitted: | 12 Jun 2013 13:13 | Modified: | 21 Jul 2014 19:09 |
Reporter: | George Kaz | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Replication | Severity: | S3 (Non-critical) |
Version: | 5.5.29 | OS: | Linux |
Assigned to: | CPU Architecture: | Any | |
Tags: | logging, replication |
[12 Jun 2013 13:13]
George Kaz
[13 Jun 2013 11:31]
MySQL Verification Team
Thank you for the bug report. Please provide a complete test case your INSERT...ON DUPLICATE KEY UPDATE is incomplete . Thanks.
[17 Jun 2013 9:06]
George Kaz
Thanks for the reply. Here's one example from my err log. There are 1000s of these, all of the same format. 130408 9:18:21 [Warning] Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... ON DUPLICATE KEY UPDATE on a table with more than one UNIQUE KEY is unsafe Statement: INSERT INTO `smwp_options` (`option_name`, `option_value`, `autoload`) VALUES ('_site_transient_timeout_theme_roots', '1365410901', 'yes') ON DUPLICATE KEY UPDATE `option_name` = VALUES(`option_name`), `option_value` = VALUES(`option_value`), `autoload` = VALUES(`autoload`)
[17 Jun 2013 9:09]
George Kaz
Note on my last reply. The table name is different from the one I gave in the original create statement but the table schema is the same. The error relates to the same table; the difference is only in what I have entered on this bug thread.
[21 Jul 2014 19:09]
Sveta Smirnova
Thank you for the report. > INSERT INTO wp_options(option_name, option_value, autoload) Values ('myuniquename', 'blahblahblah', 'autoload') ON DUPLICATE KEY UPDATE > > The above produces an unsafe statement warning when it's not unsafe because the only key being referenced in the insert is option_name. It does not matter how many key you are referencing in the INSERT statement. It is still unsafe and can lead to unpredictable result if your table has more than 1 unique key. And your table has two.
[21 Jul 2014 19:09]
Sveta Smirnova
Closing as "Not a Bug".