Statements that are unsafe for SBR.
Not all statements which modify data (such as INSERT DELETE, UPDATE, and REPLACE statements)
can be replicated using statement-based replication. Any nondeterministic behavior is difficult
to replicate when using statement-based replication. Examples of such DML (Data Modification
Language) statements include the following:
• A statement that depends on a UDF or stored program that is nondeterministic, since the value
returned by such a UDF or stored program or depends on factors other than the parameters
supplied to it. (Row-based replication, however, simply replicates the value returned by the UDF
or stored program, so its effect on table rows and data is the same on both the master and slave.)
See Section 16.4.1.11, “Replication of Invoked Features”, for more information.
• DELETE and UPDATE statements that use a LIMIT clause without an ORDER BY are
nondeterministic. See Section 16.4.1.16, “Replication and LIMIT”.
• Statements using any of the following functions cannot be replicated properly using statementbased
replication:
• LOAD_FILE() [1201]
• UUID() [1300], UUID_SHORT() [1301]
• USER() [1293]
• FOUND_ROWS() [1288]
• SYSDATE() [1243] (unless both the master and the slave are started with the --sysdate-isnow
[458] option)
• GET_LOCK() [1295]
• IS_FREE_LOCK() [1298]
• IS_USED_LOCK() [1299]
• MASTER_POS_WAIT() [1299]
• RAND() [1226]
• RELEASE_LOCK() [1300]
• SLEEP() [1300]
• VERSION() [1293]
However, all other functions are replicated correctly using statement-based replication, including
NOW() [1240] and so forth.
For more information, see Section 16.4.1.15, “Replication and System Functions”.
Statements that cannot be replicated correctly using statement-based replication are logged with a
warning like the one shown here:
090213 16:58:54 [Warning] Statement is not safe to log in statement format.
A similar warning is also issued to the client in such cases. The client can display it using SHOW
WARNINGS.
... zobacz całą notatkę
Komentarze użytkowników (0)