title: MySQL Replication & Triggers
body: <p>I have stumbled upon an interesting MySQL Error message that I do not really know how to interpret.</p>
  <p>The setup:</p>
  <ul>
  <li>There are two tables A and B.</li>
  <li>When data is written or updated in the table A, then a trigger is writing data to the table B.</li>
  <li>Operations happen on a Master database</li>
  <li>Data is replicated to a slave server</li>
  </ul>
  <p>Now, whenever I decide to update data in table A, then it is updated and the corresponding log message is written to table B. MySQL, however, spawns the following error message:</p>
  <blockquote>
  <p>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.</p>
  <p>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.</p>
  <p>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.</p>
  </blockquote>
  <p>Nothing happy to the eye. How can I avoid these?</p>