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 <sachin.setiya@mariadb.com>
This commit is contained in:
Sachin Setiya 2017-04-26 11:01:51 +05:30
commit e180c35619
4 changed files with 17 additions and 6 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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"

View file

@ -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)