diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2015-03-11 14:57:30 +0100 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2015-03-11 14:57:30 +0100 |
commit | be73c7ee4415af4c1188689e1642a39512c2ecbd (patch) | |
tree | b18095198c1d404bb8c0d015be039d064be60814 | |
parent | 9f4ee16bf351ea2969d73abcdea92e70538c723c (diff) | |
download | mariadb-git-be73c7ee4415af4c1188689e1642a39512c2ecbd.tar.gz |
MDEV-6951: Erroneous SET STATEMENT produces two identical errors
Double error reporting removed.
-rw-r--r-- | mysql-test/r/set_statement.result | 8 | ||||
-rw-r--r-- | mysql-test/t/set_statement.test | 8 | ||||
-rw-r--r-- | sql/sql_yacc.yy | 4 |
3 files changed, 17 insertions, 3 deletions
diff --git a/mysql-test/r/set_statement.result b/mysql-test/r/set_statement.result index 51687caeb21..bf367b505f3 100644 --- a/mysql-test/r/set_statement.result +++ b/mysql-test/r/set_statement.result @@ -1138,3 +1138,11 @@ password(a) deallocate prepare stmt1; drop table t1; set @@old_passwords=@save_old_passwords; +# +#MDEV-6951:Erroneous SET STATEMENT produces two identical errors +# +set statement non_existing=1 for select 1; +ERROR HY000: Unknown system variable 'non_existing' +show errors; +Level Code Message +Error 1193 Unknown system variable 'non_existing' diff --git a/mysql-test/t/set_statement.test b/mysql-test/t/set_statement.test index 6421317935a..75d70b11858 100644 --- a/mysql-test/t/set_statement.test +++ b/mysql-test/t/set_statement.test @@ -1068,3 +1068,11 @@ execute stmt1; deallocate prepare stmt1; drop table t1; set @@old_passwords=@save_old_passwords; + +--echo # +--echo #MDEV-6951:Erroneous SET STATEMENT produces two identical errors +--echo # + +--error ER_UNKNOWN_SYSTEM_VARIABLE +set statement non_existing=1 for select 1; +show errors; diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 5021e475903..492e774509e 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -367,9 +367,7 @@ find_sys_var_null_base(THD *thd, struct sys_var_with_base *tmp) { tmp->var= find_sys_var(thd, tmp->base_name.str, tmp->base_name.length); - if (tmp->var == NULL) - my_error(ER_UNKNOWN_SYSTEM_VARIABLE, MYF(0), tmp->base_name.str); - else + if (tmp->var != NULL) tmp->base_name= null_lex_str; return thd->is_error(); |