summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <malff@lambda.hsd1.co.comcast.net.>2008-03-21 12:08:04 -0600
committerunknown <malff@lambda.hsd1.co.comcast.net.>2008-03-21 12:08:04 -0600
commit194e43ee68e9f1acb9d1ef380894c4fc4c27f22e (patch)
tree555f43e3e764f45a661e34954e97346de3b0aabc /mysql-test
parent6c61454bcd01aaa59bfb991824f96fd3358b05ad (diff)
downloadmariadb-git-194e43ee68e9f1acb9d1ef380894c4fc4c27f22e.tar.gz
Bug#8759 (Stored Procedures: SQLSTATE '00000' should be illegal)
Fixed the parser to reject SQLSTATE '00000', since '00000' is the successful completion condition, and can not be caught by an exception handler in SQL. mysql-test/r/sp-error.result: Bug#8759 (Stored Procedures: SQLSTATE '00000' should be illegal) mysql-test/t/sp-error.test: Bug#8759 (Stored Procedures: SQLSTATE '00000' should be illegal) sql/sp_pcontext.cc: Bug#8759 (Stored Procedures: SQLSTATE '00000' should be illegal)
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/sp-error.result12
-rw-r--r--mysql-test/t/sp-error.test26
2 files changed, 38 insertions, 0 deletions
diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result
index bc2ab13fe5f..5ac61821cea 100644
--- a/mysql-test/r/sp-error.result
+++ b/mysql-test/r/sp-error.result
@@ -1638,3 +1638,15 @@ Warning 1287 The syntax 'TYPE=storage_engine' is deprecated and will be removed
call p1();
call p1();
drop procedure p1;
+drop procedure if exists proc_8759;
+create procedure proc_8759()
+begin
+declare should_be_illegal condition for sqlstate '00000';
+declare continue handler for should_be_illegal set @x=0;
+end$$
+ERROR 42000: Bad SQLSTATE: '00000'
+create procedure proc_8759()
+begin
+declare continue handler for sqlstate '00000' set @x=0;
+end$$
+ERROR 42000: Bad SQLSTATE: '00000'
diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test
index 23bce3805af..6896a1ab832 100644
--- a/mysql-test/t/sp-error.test
+++ b/mysql-test/t/sp-error.test
@@ -2387,6 +2387,32 @@ call p1();
drop procedure p1;
#
+# Bug#8759 (Stored Procedures: SQLSTATE '00000' should be illegal)
+#
+
+--disable_warnings
+drop procedure if exists proc_8759;
+--enable_warnings
+
+delimiter $$;
+
+--error ER_SP_BAD_SQLSTATE
+create procedure proc_8759()
+begin
+ declare should_be_illegal condition for sqlstate '00000';
+ declare continue handler for should_be_illegal set @x=0;
+end$$
+
+--error ER_SP_BAD_SQLSTATE
+create procedure proc_8759()
+begin
+ declare continue handler for sqlstate '00000' set @x=0;
+end$$
+
+delimiter ;$$
+
+
+#
# BUG#NNNN: New bug synopsis
#
#--disable_warnings