From e180c35619c91c2256f2bb8c24b4f423c92acc7f Mon Sep 17 00:00:00 2001 From: Sachin Setiya Date: Wed, 26 Apr 2017 11:01:51 +0530 Subject: MDEV-12017 Unclear error with flashback: Variable 'binlog_format' can't ... When WSREP(thd) is not true we will use my_error(...) to print error. This will set thd->is_error() to true and we wont be getting generic error. Signed-off-by: Sachin Setiya --- sql/sys_vars.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'sql/sys_vars.cc') diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index a3bc3f6d9cf..73ce519e858 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -456,13 +456,13 @@ 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 (var->type == OPT_GLOBAL) - { - WSREP_ERROR("MariaDB Galera and flashback do not support binlog format: %s", + if (WSREP(thd)) + WSREP_ERROR("MariaDB Galera does not support binlog format: %s", binlog_format_names[var->save_result.ulonglong_value]); - return true; - } + 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) -- cgit v1.2.1 From eb55a9df5253adb4f6d44e48d4097db8dc483949 Mon Sep 17 00:00:00 2001 From: Sachin Setiya Date: Thu, 27 Apr 2017 21:20:02 +0530 Subject: Mdev-12017 Post Fix Allow setting up binlog_format other then row for session scope for galera/ flashback. Ref:- Mdev-7322 --- sql/sys_vars.cc | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'sql/sys_vars.cc') 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) -- cgit v1.2.1