I have a classical statement-based replication between the master and the slave. Triggers were created on the master and replicated on the slave as well.
Assuming that I have, say an
ON UPDATE trigger, is the following correct?
MySQL will only write to the binary log statements that were not the result of the trigger. Data consistency between the master and the slave is therefore ensured by the fact that the same triggers are present on both.
The relevance of this pertains to incremental updates (or accumulutors), eg.
CREATE TRIGGER vesion_increment AFTER UPDATE ON table
FOR EACH ROW
UPDATE table SET version=version+1;
In this case, the
UPDATE table SET version=version+1 will not be in the binary log and hence not replicated but taken care of by the same trigger on the slave. Is that correct?