在5.6之后版本中,如果binlog格式设置为statement 。那么 insert .....select .....语句将是不安全。如下报警信息
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.
不安全主要是因为 insert ......select ......操作原理,其中用到了临时表。