From eb55a9df5253adb4f6d44e48d4097db8dc483949 Mon Sep 17 00:00:00 2001 From: Sachin Setiya Date: Thu, 27 Apr 2017 21:20:02 +0530 Subject: [PATCH] Mdev-12017 Post Fix Allow setting up binlog_format other then row for session scope for galera/ flashback. Ref:- Mdev-7322 --- mysql-test/suite/binlog/r/flashback.result | 3 ++- mysql-test/suite/binlog/t/flashback.test | 1 - mysql-test/suite/wsrep/disabled.def | 1 - sql/sys_vars.cc | 25 ++++++++++++++++------ 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/mysql-test/suite/binlog/r/flashback.result b/mysql-test/suite/binlog/r/flashback.result index 65c208d1653..8d850a8c87b 100644 --- a/mysql-test/suite/binlog/r/flashback.result +++ b/mysql-test/suite/binlog/r/flashback.result @@ -503,7 +503,8 @@ a b 3 2 4 3 SET binlog_format=statement; -ERROR HY000: Flashback does not support binlog_format STATEMENT +Warnings: +Warning 1105 MariaDB Galera and flashback do not support binlog format: STATEMENT SET GLOBAL binlog_format=statement; ERROR HY000: Flashback does not support binlog_format STATEMENT DROP TABLE t1; diff --git a/mysql-test/suite/binlog/t/flashback.test b/mysql-test/suite/binlog/t/flashback.test index d5ec610c90d..8ef38dbcb9f 100644 --- a/mysql-test/suite/binlog/t/flashback.test +++ b/mysql-test/suite/binlog/t/flashback.test @@ -160,7 +160,6 @@ let $MYSQLD_DATADIR= `select @@datadir`; SELECT * FROM t1; ---error ER_FLASHBACK_NOT_SUPPORTED SET binlog_format=statement; --error ER_FLASHBACK_NOT_SUPPORTED SET GLOBAL binlog_format=statement; diff --git a/mysql-test/suite/wsrep/disabled.def b/mysql-test/suite/wsrep/disabled.def index a9a0122ae30..605f063f967 100644 --- a/mysql-test/suite/wsrep/disabled.def +++ b/mysql-test/suite/wsrep/disabled.def @@ -1,2 +1 @@ foreign_key : MDEV-7915 -binlog_format : MDEV-11532 diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 73ce519e858..209b17ff377 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -456,13 +456,24 @@ static bool binlog_format_check(sys_var *self, THD *thd, set_var *var) push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR, "MariaDB Galera and flashback do not support binlog format: %s", binlog_format_names[var->save_result.ulonglong_value]); - if (WSREP(thd)) - WSREP_ERROR("MariaDB Galera does not support binlog format: %s", - binlog_format_names[var->save_result.ulonglong_value]); - else - my_error(ER_FLASHBACK_NOT_SUPPORTED,MYF(0),"binlog_format", - binlog_format_names[var->save_result.ulonglong_value]); - return true; + /* + We allow setting up binlog_format other then ROW for session scope when + wsrep/flasback is enabled.This is done because of 2 reasons + 1. User might want to run pt-table-checksum. + 2. SuperUser knows what is doing :-) + + For refrence:- MDEV-7322 + */ + if (var->type == OPT_GLOBAL) + { + if (WSREP(thd)) + WSREP_ERROR("MariaDB Galera does not support binlog format: %s", + binlog_format_names[var->save_result.ulonglong_value]); + else + my_error(ER_FLASHBACK_NOT_SUPPORTED,MYF(0),"binlog_format", + binlog_format_names[var->save_result.ulonglong_value]); + return true; + } } if (var->type == OPT_GLOBAL)