diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result
index ed477a8519b889f2b96f5753e512d82f51064ae0..1cc48d2aeac0c164bc97d214fa9e5a011bf53c52 100644
--- a/mysql-test/r/variables.result
+++ b/mysql-test/r/variables.result
@@ -335,3 +335,8 @@ Table	Op	Msg_type	Msg_text
 test.t1	check	status	OK
 test.t2	check	status	OK
 drop table t1,t2;
+select @@xxxxxxxxxx;
+Unknown system variable 'xxxxxxxxxx'
+select 1;
+1
+1
diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test
index 5863cb97d5781600e3e8f9a7321ac931e6516c9f..639a28edd38d8814225bf356c1519400fdbdb948 100644
--- a/mysql-test/t/variables.test
+++ b/mysql-test/t/variables.test
@@ -241,3 +241,10 @@ select * from t2 where a=3;
 check table t1,t2;
 drop table t1,t2;
 
+#
+# error conditions
+#
+
+--error 1193
+select @@xxxxxxxxxx;
+select 1;