• unknown's avatar
    * Fix for a potential bug: · a48480d7
    unknown authored
    when the SQL thread stops, set rli->inside_transaction to 0. This is needed if the user
    later restarts replication from a completely different place where there are only autocommit
    statements.
    * Detect the case where the master died while flushing the binlog cache to the binlog
    and stop with error. Cannot add a testcase for this in 4.0 (I tested it manually)
    as the slave always runs with --skip-innodb.
    
    
    sql/log_event.cc:
      Detect the case where the master died while flushing the binlog cache to the binlog:
      in that case, we have a BEGIN with no COMMIT/ROLLBACK in the relay log; we detect
      this with rli->inside_transaction in Rotate_log_event::exec_event() (which is the
      only right place to detect this, see comments). When we see it, we stop with error.
      In 4.1, I had put code in Start_log_event::exec_event(); I'll remove it next time
      I push in the 4.1 tree.
    sql/slave.cc:
      * Use slave_print_error instead of sql_print_error, to put the info in SHOW SLAVE STATUS too.
      * Fix for a potential bug:
      when the SQL thread stops, set rli->inside_transaction to 0. This is not needed if
      replication later restarts from the same position; but this is needed if the user
      restarts replication from a completely different place where there are only autocommit
      statements (in that case, if we didn't set to 0, the position would never increment in SHOW
      SLAVE STATUS, even if queries are processed well).
    a48480d7
slave.cc 104 KB