MySQL复制和触发器

我偶然发现了一条有趣的
MySQL错误消息,我真的不知道如何解释.

设置:

>有两个表A和B.
>当在表A中写入或更新数据时,触发器正在将数据写入表B.
>操作发生在Master数据库上
>数据被复制到从属服务器

现在,每当我决定更新表A中的数据时,它就会更新并将相应的日志消息写入表B.但是,MySQL会产生以下错误消息:

Note: #1592 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.

Note: #1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctly.

Note: #1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave.

没什么好开心的.我怎么能避免这些?

最佳答案 请参阅Google讨论组“percona-discussion”中的此电子邮件交换.

> https://groups.google.com/forum/?fromgroups#!topic/percona-discussion/21Em_gdE0_E

注意:我为Percona工作.

点赞