1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Post-push fixes for BUG#39934

Suppress warnings if binlog_format=STATEMENT and the current
database is filtered out using --binlog-[do|ignore]-db. This
was a regression in my previous patch.


mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result:
  updated result file
mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result:
  updated result file
mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors-master.opt:
  Added binlog filtering rule.
mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test:
  Added tests that no error is printed when table is filtered out
  by binlog filtering rules.
sql/sql_class.cc:
  Don't decide logging format if the statement is filtered out
  from the binlog using binlog filtering rules.
This commit is contained in:
Sven Sandberg
2009-07-22 22:14:20 +02:00
parent d88192976c
commit fa32b4f296
5 changed files with 80 additions and 28 deletions

View File

@ -3264,7 +3264,15 @@ int THD::decide_logging_format(TABLE_LIST *tables)
variables.binlog_format));
DBUG_PRINT("info", ("lex->get_stmt_unsafe_flags(): 0x%x",
lex->get_stmt_unsafe_flags()));
if (mysql_bin_log.is_open() && (options & OPTION_BIN_LOG))
/*
We should not decide logging format if the binlog is closed or
binlogging is off, or if the statement is filtered out from the
binlog by filtering rules.
*/
if (mysql_bin_log.is_open() && (options & OPTION_BIN_LOG) &&
!(variables.binlog_format == BINLOG_FORMAT_STMT &&
!binlog_filter->db_ok(db)))
{
/*
Compute one bit field with the union of all the engine
@ -3442,8 +3450,13 @@ int THD::decide_logging_format(TABLE_LIST *tables)
else
DBUG_PRINT("info", ("decision: no logging since "
"mysql_bin_log.is_open() = %d "
"and (options & OPTION_BIN_LOG) = 0x%llx",
mysql_bin_log.is_open(), (options & OPTION_BIN_LOG)));
"and (options & OPTION_BIN_LOG) = 0x%llx "
"and binlog_format = %d "
"and binlog_filter->db_ok(db) = %d",
mysql_bin_log.is_open(),
(options & OPTION_BIN_LOG),
variables.binlog_format,
binlog_filter->db_ok(db)));
#endif
DBUG_RETURN(0);