mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
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.
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user