1: Error log mass error
150602 14:40:02 [Warning] Unsafe statement written to the binary log using statement format since Binlog_format = Statemen T. INSERT ... SELECT ... On DUPLICATE KEY UPDATE was unsafe because the order in which rows be retrieved by the SELECT determines which (if any) RO WS is updated. This order cannot is predicted and may differ on master and the slave. Statement:insert into Tab_name
2: Reason:
For the following reason, Tab_name has 2 unique keys on this table. Use the Insert ... On DUPLICATE KEY UPDATE, and the current database Binlog_format is in statement format, this SQL statement will report unsafe.
Official Handbook:
INSERT ... On DUPLICATE KEY UPDATE statements in tables with multiple primary or unique keys. When executed against a table it contains more than one primary or unique key, this statement is considered unsafe, bein G Sensitive to the order in which the storage engine checks the keys, which are not deterministic, and on which the choice of rows updated by the MySQL Server depends.
Workaround:
Set Binlog_format to row or statement or modify SQL
Mysql:unsafe statement written to the binary log using statement format since Binlog_format = statement. INSERT ...