summaryrefslogtreecommitdiff
path: root/sql/log.cc
diff options
context:
space:
mode:
authorHe Zhenxing <zhenxing.he@sun.com>2009-05-31 11:26:58 +0800
committerHe Zhenxing <zhenxing.he@sun.com>2009-05-31 11:26:58 +0800
commit5dd1abae7d2f9e56d1c3f54077057bd92387a600 (patch)
tree0c755db7145113fab3cace82e3536f6829a30360 /sql/log.cc
parent4cfc9d771a606117f37e543c1a117887cc58ec40 (diff)
downloadmariadb-git-5dd1abae7d2f9e56d1c3f54077057bd92387a600.tar.gz
BUG#43263 BEGIN skipped in some replicate-do-db cases
BEGIN/COMMIT/ROLLBACK was subject to replication db rules, and caused the boundary of a transaction not recognized correctly when these queries were ignored by the rules. Fixed the problem by skipping replication db rules for these statements. sql/log_event.cc: Skip checking replication db rules for BEGIN/COMMIT/ROLLBACK statements
Diffstat (limited to 'sql/log.cc')
-rw-r--r--sql/log.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/log.cc b/sql/log.cc
index b16303ee232..ec8f5fe820b 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -159,7 +159,7 @@ static int binlog_commit(THD *thd, bool all)
if (all || !(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))
{
Query_log_event qev(thd, STRING_WITH_LEN("COMMIT"),
- TRUE, FALSE, THD::KILLED_NO_VALUE);
+ TRUE, TRUE, THD::KILLED_NO_VALUE);
qev.error_code= 0; // see comment in MYSQL_LOG::write(THD, IO_CACHE)
DBUG_RETURN(binlog_end_trans(thd, trans_log, &qev));
}
@@ -204,7 +204,7 @@ static int binlog_rollback(THD *thd, bool all)
if (unlikely(thd->transaction.all.modified_non_trans_table))
{
Query_log_event qev(thd, STRING_WITH_LEN("ROLLBACK"),
- TRUE, FALSE, THD::KILLED_NO_VALUE);
+ TRUE, TRUE, THD::KILLED_NO_VALUE);
qev.error_code= 0; // see comment in MYSQL_LOG::write(THD, IO_CACHE)
error= binlog_end_trans(thd, trans_log, &qev);
}
@@ -2094,7 +2094,7 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache, Log_event *commit_event)
statement in autocommit mode.
*/
Query_log_event qinfo(thd, STRING_WITH_LEN("BEGIN"),
- TRUE, FALSE, THD::KILLED_NO_VALUE);
+ TRUE, TRUE, THD::KILLED_NO_VALUE);
/*
Imagine this is rollback due to net timeout, after all
statements of the transaction succeeded. Then we want a