summaryrefslogtreecommitdiff
path: root/sql/log_event.cc
diff options
context:
space:
mode:
authorunknown <sven@riska.(none)>2007-12-21 20:30:23 +0100
committerunknown <sven@riska.(none)>2007-12-21 20:30:23 +0100
commitb5d95f021f1f984384897890d9335f5bd23c4ba6 (patch)
tree45eecaeee660069e4aa9ce0e0e5b4c2fdc73659f /sql/log_event.cc
parent590350633c23d3d986e9d3c8745aa8f0bbb78105 (diff)
downloadmariadb-git-b5d95f021f1f984384897890d9335f5bd23c4ba6.tar.gz
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.
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r--sql/log_event.cc1
1 files changed, 1 insertions, 0 deletions
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));
}