commit e180c35619c91c2256f2bb8c24b4f423c92acc7f Author: Sachin Setiya Date: Wed Apr 26 11:01:51 2017 +0530 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 diff --git a/mysql-test/suite/binlog/r/flashback.result b/mysql-test/suite/binlog/r/flashback.result index a7973b3..65c208d 100644 --- a/mysql-test/suite/binlog/r/flashback.result +++ b/mysql-test/suite/binlog/r/flashback.result @@ -502,4 +502,8 @@ a b 2 1 3 2 4 3 +SET binlog_format=statement; +ERROR HY000: Flashback does 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 2f395a2..d5ec610 100644 --- a/mysql-test/suite/binlog/t/flashback.test +++ b/mysql-test/suite/binlog/t/flashback.test @@ -160,4 +160,9 @@ 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; + DROP TABLE t1; diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index e1ed868..1f4cf31 100644 --- a/sql/share/errmsg-utf8.txt +++ b/sql/share/errmsg-utf8.txt @@ -7453,3 +7453,5 @@ ER_JSON_PATH_EMPTY eng "Path expression '$' is not allowed in argument %d to function '%s'." ER_SLAVE_SAME_ID eng "A slave with the same server_uuid/server_id as this slave has connected to the master" +ER_FLASHBACK_NOT_SUPPORTED + eng "Flashback does not support %s %s" diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index a3bc3f6..73ce519 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)