Replication Formats Statements with the following characteristics are considered unsafe: For more information, see Section 17.5.1.14, “Replication and System Functions” . Nondeterministic functions not considered unsafe.   Although these functions are not deterministic, they are treated as safe for purposes of logging and replication:  CONNECTION_ID() ,  CURDATE() , CURRENT_DATE() ,  CURRENT_TIME() ,  CURRENT_TIMESTAMP() ,  CURTIME() ,,  LAST_INSERT_ID() , LOCALTIME() ,  LOCALTIMESTAMP() ,  NOW() ,  UNIX_TIMESTAMP() ,  UTC_DATE() ,  UTC_TIME() , and UTC_TIMESTAMP() . In addition, an  INSERT  into a table that has a composite primary key containing an  AUTO_INCREMENT column that is not the first column of this composite key is unsafe. For more information, see Section 17.5.1.1, “Replication and AUTO_INCREMENT” . An  INSERT ... ON DUPLICATE KEY UPDATE  statement against a table having more than one unique or primary key is marked as unsafe for statement-based replication. (Bug #11765650, Bug #58637) For more information, see Section 17.5.1.35, “Replication and Transactions” . • Statements containing system functions that may return a different value on the replica.  These functions include  FOUND_ROWS() ,  GET_LOCK() ,  IS_FREE_LOCK() ,  IS_USED_LOCK() , LOAD_FILE() ,  MASTER_POS_WAIT() ,  RAND() ,  RELEASE_LOCK() ,  ROW_COUNT() , SESSION_USER() ,  SLEEP() ,  SYSDATE() ,  SYSTEM_USER() ,  USER() ,  UUID() , and  UUID_SHORT() . • References to system variables.   Most system variables are not replicated correctly using the statement-based format. See Section 17.5.1.39, “Replication and Variables” . For exceptions, see Section 5.4.4.3, “Mixed Binary Logging Format” . • Loadable Functions.   Since we have no control over what a loadable function does, we must assume that it is executing unsafe statements. • Fulltext plugin.   This plugin may behave differently on different MySQL servers; therefore, statements depending on it could have different results. For this reason, all statements relying on the fulltext plugin are treated as unsafe in MySQL. • Trigger or stored program updates a table having an AUTO_INCREMENT column.   This is unsafe because the order in which the rows are updated may differ on the source and the replica. • INSERT ... ON DUPLICATE KEY UPDATE statements on tables with multiple primary or unique keys.   When executed against a table that contains more than one primary or unique key, this statement is considered unsafe, being sensitive to the order in which the storage engine checks the keys, which is not deterministic, and on which the choice of rows updated by the MySQL Server depends. • Updates using LIMIT.   The order in which rows are retrieved is not specified, and is therefore considered unsafe. See Section 17.5.1.18, “Replication and LIMIT” . • Accesses or references log tables.   The contents of the system log table may differ between source and replica. • Nontransactional operations after transactional operations.   Within a transaction, allowing any nontransactional reads or writes to execute after any transactional reads or writes is considered unsafe. • Accesses or references self-logging tables.   All reads and writes to self-logging tables are considered unsafe. Within a transaction, any statement following a read or write to self-logging tables is also considered unsafe. 3591