From b5d95f021f1f984384897890d9335f5bd23c4ba6 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 21 Dec 2007 20:30:23 +0100 Subject: BUG#26395: if crash during autocommit update to transactional table on master, slave fails Now, every transaction (including autocommit transactions) start with a BEGIN and end with a COMMIT/ROLLBACK in the binlog. Added a test case, and updated lots of test case result files. mysql-test/t/rpl_transaction-master.opt: BitKeeper file /home/sven/bk/b26395-autocommit-xa/5.0-rpl/mysql-test/t/rpl_transaction-master.opt mysql-test/t/rpl_transaction-slave.opt: BitKeeper file /home/sven/bk/b26395-autocommit-xa/5.0-rpl/mysql-test/t/rpl_transaction-slave.opt mysql-test/r/mix_innodb_myisam_binlog.result: Updated result file mysql-test/r/multi_update.result: Updated result file mysql-test/r/rpl_transaction.result: New result file for new test case. mysql-test/r/sp_trans_log.result: Updated result file mysql-test/r/variables-big.result: Updated result file mysql-test/t/rpl_transaction.test: New test case. sql/log.cc: - Always write BEGIN and COMMIT around statements, even in autocommit mode. - Added comments for binlog_commit and binlog_rollback. sql/log_event.cc: Added debug trigger to avoid writing xid events to the binlog. --- sql/log_event.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'sql/log_event.cc') diff --git a/sql/log_event.cc b/sql/log_event.cc index 965dfb5f5cf..a950094a018 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -3793,6 +3793,7 @@ Xid_log_event(const char* buf, #ifndef MYSQL_CLIENT bool Xid_log_event::write(IO_CACHE* file) { + DBUG_EXECUTE_IF("do_not_write_xid", return 0;); return write_header(file, sizeof(xid)) || my_b_safe_write(file, (byte*) &xid, sizeof(xid)); } -- cgit v1.2.1