summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2020-06-18 11:49:07 +0300
committerMonty <monty@mariadb.org>2020-06-19 12:03:13 +0300
commit00bd52b14722737b3e8d22dc8c3fcbeeab8efeef (patch)
tree5130d0a83ca2c92506614d3b0e0a4da7b439a42a /sql/sql_class.cc
parent1a49c5eb4d11dd6a35d293856281239d8e459582 (diff)
downloadmariadb-git-00bd52b14722737b3e8d22dc8c3fcbeeab8efeef.tar.gz
Added THD::binlog_table_should_be_logged() to simplify some code
- Added missing test for binlog_filter to ALTER TABLE
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r--sql/sql_class.cc22
1 files changed, 17 insertions, 5 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index c370008d96e..e11ca8c9c69 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -5964,11 +5964,8 @@ int THD::decide_logging_format(TABLE_LIST *tables)
}
#endif /* WITH_WSREP */
- if ((WSREP_EMULATE_BINLOG_NNULL(this) ||
- (mysql_bin_log.is_open() &&
- (variables.option_bits & OPTION_BIN_LOG))) &&
- !(wsrep_binlog_format() == BINLOG_FORMAT_STMT &&
- !binlog_filter->db_ok(db.str)))
+ if (WSREP_EMULATE_BINLOG_NNULL(this) ||
+ binlog_table_should_be_logged(&db))
{
if (is_bulk_op())
{
@@ -6492,6 +6489,21 @@ exit:;
}
#ifndef MYSQL_CLIENT
+/**
+ Check if we should log a table DDL to the binlog
+
+ @@return true yes
+ @@return false no
+*/
+
+bool THD::binlog_table_should_be_logged(const LEX_CSTRING *db)
+{
+ return (mysql_bin_log.is_open() &&
+ (variables.option_bits & OPTION_BIN_LOG) &&
+ (wsrep_binlog_format() != BINLOG_FORMAT_STMT ||
+ binlog_filter->db_ok(db->str)));
+}
+
/*
Template member function for ensuring that there is an rows log
event of the apropriate type before proceeding.