diff options
author | Luis Soares <luis.soares@sun.com> | 2009-06-27 14:18:47 +0100 |
---|---|---|
committer | Luis Soares <luis.soares@sun.com> | 2009-06-27 14:18:47 +0100 |
commit | 92956ef6277c3eafbfecc341cd39135e8e8579d0 (patch) | |
tree | e3c206f742bfa80b43f50ad33e91da0fc18a3fc3 /sql/sql_class.cc | |
parent | eefdd70ab2bf00146c399a3ed042f77ac74730b8 (diff) | |
download | mariadb-git-92956ef6277c3eafbfecc341cd39135e8e8579d0.tar.gz |
BUG#42851: Spurious "Statement is not safe to log in statement
format." warnings
Despite the fact that a statement would be filtered out from binlog, a
warning would still be thrown if it was issued with the LIMIT.
This patch addresses this issue by checking the filtering rules before
printing out the warning.
mysql-test/suite/binlog/t/binlog_stm_unsafe_warning-master.opt:
Parameter to filter out database: "b42851".
mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test:
Added a new test case.
sql/sql_class.cc:
Added filtering rules check to condition used to decide whether to
printout warning or not.
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r-- | sql/sql_class.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 409e4dc4b8b..48ddb42f0d8 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -27,6 +27,7 @@ #include "mysql_priv.h" #include "rpl_rli.h" +#include "rpl_filter.h" #include "rpl_record.h" #include "slave.h" #include <my_bitmap.h> @@ -3684,7 +3685,8 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype, char const *query_arg, we should print a warning. */ if (sql_log_bin_toplevel && lex->is_stmt_unsafe() && - variables.binlog_format == BINLOG_FORMAT_STMT) + variables.binlog_format == BINLOG_FORMAT_STMT && + binlog_filter->db_ok(this->db)) { /* A warning can be elevated a error when STRICT sql mode. |