summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authorLuis Soares <luis.soares@sun.com>2009-09-24 15:52:52 +0100
committerLuis Soares <luis.soares@sun.com>2009-09-24 15:52:52 +0100
commit5e04d4695ba8dfef7945882923b977df554be2e2 (patch)
tree853b60ee4d659a71d405efc7d93c0968b3f44bd5 /sql/sql_base.cc
parent600703e50ac3de8542e909ba08674919489cfdcc (diff)
downloadmariadb-git-5e04d4695ba8dfef7945882923b977df554be2e2.tar.gz
BUG#42829: binlogging enabled for all schemas regardless of
binlog-db-db / binlog-ignore-db InnoDB will return an error if statement based replication is used along with transaction isolation level READ-COMMITTED (or weaker), even if the statement in question is filtered out according to the binlog-do-db rules set. In this case, an error should not be printed. This patch addresses this issue by extending the existing check in external_lock to take into account the filter rules before deciding to print an error. Furthermore, it also changes decide_logging_format to take into consideration whether the statement is filtered out from binlog before decision is made.
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index f55d3fc5006..7de345ba0e7 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -24,6 +24,7 @@
#include <m_ctype.h>
#include <my_dir.h>
#include <hash.h>
+#include "rpl_filter.h"
#ifdef __WIN__
#include <io.h>
#endif
@@ -5094,7 +5095,16 @@ static void mark_real_tables_as_free_for_reuse(TABLE_LIST *table)
int decide_logging_format(THD *thd, TABLE_LIST *tables)
{
- if (mysql_bin_log.is_open() && (thd->options & OPTION_BIN_LOG))
+ /*
+ In SBR mode, we are only proceeding if we are binlogging this
+ statement, ie, the filtering rules won't later filter this out.
+
+ This check here is needed to prevent some spurious error to be
+ raised in some cases (See BUG#42829).
+ */
+ if (mysql_bin_log.is_open() && (thd->options & OPTION_BIN_LOG) &&
+ (thd->variables.binlog_format != BINLOG_FORMAT_STMT ||
+ binlog_filter->db_ok(thd->db)))
{
/*
Compute the starting vectors for the computations by creating a