diff options
author | Luis Soares <luis.soares@sun.com> | 2009-11-01 23:13:11 +0000 |
---|---|---|
committer | Luis Soares <luis.soares@sun.com> | 2009-11-01 23:13:11 +0000 |
commit | 34982004402fabf6d4d5fd39df1c7ad207fde74a (patch) | |
tree | bd5dd194e776b9de2507c0b9b21f46cfcb0a6207 /sql | |
parent | 612a8ccb2c9667fb57e92a7af5ede7cdf76fb884 (diff) | |
parent | 5e04d4695ba8dfef7945882923b977df554be2e2 (diff) | |
download | mariadb-git-34982004402fabf6d4d5fd39df1c7ad207fde74a.tar.gz |
BUG#42829: manually merged approved bzr bundle from bug report.
Conflicts
=========
Text conflict in sql/sql_class.cc
1 conflicts encountered.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_base.cc | 12 | ||||
-rw-r--r-- | sql/sql_class.cc | 5 |
2 files changed, 16 insertions, 1 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc index e706bd04ea6..af18660b9a5 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -25,6 +25,7 @@ #include <m_ctype.h> #include <my_dir.h> #include <hash.h> +#include "rpl_filter.h" #ifdef __WIN__ #include <io.h> #endif @@ -5098,7 +5099,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 diff --git a/sql/sql_class.cc b/sql/sql_class.cc index ddcd1cee4e9..a12b0198c98 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -3045,6 +3045,11 @@ extern "C" void thd_mark_transaction_to_rollback(MYSQL_THD thd, bool all) { mark_transaction_to_rollback(thd, all); } + +extern "C" bool thd_binlog_filter_ok(const MYSQL_THD thd) +{ + return binlog_filter->db_ok(thd->db); +} #endif // INNODB_COMPATIBILITY_HOOKS */ /**************************************************************************** |