32b*_*oat 1 mysql innodb replication logs mysql-5.5
由于 mysql 错误日志中的一些警告,我有点恼火。示例 1:
[Warning] Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.
The statement is unsafe because it uses a LIMIT clause.
This is unsafe because the set of rows included cannot be predicted.
Statement: UPDATE `table` SET `status` = '1' WHERE `ID` = '15800' LIMIT 1
Run Code Online (Sandbox Code Playgroud)
我的同事写了这些语句,我一直想知道在使用显式 ID 时限制语句的目的。尽管如此,不使用 LIMIT也会出现此警告。
示例 2:
[Warning] Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.
The statement is unsafe because it uses a LIMIT clause.
This is unsafe because the set of rows included cannot be predicted.
Statement: DELETE FROM table WHERE id = 426888
Run Code Online (Sandbox Code Playgroud)
在这种情况下可能有什么问题?
你有 LIMIT 没有 ORDER BY。因此,这是没有意义的。
没有 ORDER BY 的集合没有隐含的顺序。错误消息告诉您:
这是不安全的,因为无法预测包含的行集
您的 DELETE 是否有触发器或带有 LIMIT 的触发器?
| 归档时间: |
|
| 查看次数: |
2216 次 |
| 最近记录: |