[Commits] be73c7e: MDEV-6951: Erroneous SET STATEMENT produces two identical errors

sanja at mariadb.com sanja at mariadb.com
Wed Mar 11 15:57:33 EET 2015


revision-id: be73c7ee4415af4c1188689e1642a39512c2ecbd
parent(s): 9f4ee16bf351ea2969d73abcdea92e70538c723c
committer: Oleksandr Byelkin
branch nick: server
timestamp: 2015-03-11 14:57:30 +0100
message:

MDEV-6951: Erroneous SET STATEMENT produces two identical errors

Double error reporting removed.

---
 mysql-test/r/set_statement.result | 8 ++++++++
 mysql-test/t/set_statement.test   | 8 ++++++++
 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 51687ca..bf367b5 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 6421317..75d70b1 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 5021e47..492e774 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();


More information about the commits mailing list