From 194e43ee68e9f1acb9d1ef380894c4fc4c27f22e Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 21 Mar 2008 12:08:04 -0600 Subject: 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) --- mysql-test/r/sp-error.result | 12 ++++++++++++ mysql-test/t/sp-error.test | 26 ++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) (limited to 'mysql-test') 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 @@ -2386,6 +2386,32 @@ call p1(); 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 # -- cgit v1.2.1