diff options
author | Alexander Nozdrin <alik@sun.com> | 2009-11-05 13:58:14 +0300 |
---|---|---|
committer | Alexander Nozdrin <alik@sun.com> | 2009-11-05 13:58:14 +0300 |
commit | 132c439a0b52d0841d8876757c1a8e5b13dfa8fe (patch) | |
tree | 813ba28abf700c366d7ff928bd20c29830083ff7 /sql | |
parent | 89cfb564e3ac3d92c582052d59bd512c343a0944 (diff) | |
parent | 2ad0d6910cf7476c08e7a4fb77e30c959ffa0e80 (diff) | |
download | mariadb-git-132c439a0b52d0841d8876757c1a8e5b13dfa8fe.tar.gz |
Manual merge from mysql-5.1.
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 */ /**************************************************************************** |