diff options
author | unknown <pem@mysql.com> | 2005-11-08 14:47:33 +0100 |
---|---|---|
committer | unknown <pem@mysql.com> | 2005-11-08 14:47:33 +0100 |
commit | 850cfe786a39c6088be8647cc8d2b35c765841aa (patch) | |
tree | f3386973e70af797c2b17c730bac744dcfa22b77 /mysql-test/t/sp.test | |
parent | a67e6fdf8ba67fcefd7d2009e3cef2a45c68df25 (diff) | |
download | mariadb-git-850cfe786a39c6088be8647cc8d2b35c765841aa.tar.gz |
Fixed BUG#14643: Stored Procedure: Continuing after failed var.
initialization crashes server.
Make sure variables are initialized to something (like null) when
the default initialization fails and a continue handler is in effect.
mysql-test/r/sp.result:
New test case for BUG#14643.
mysql-test/t/sp.test:
New test case for BUG#14643.
sql/sp_head.cc:
Make sure variables are initialized to something (like null) when
the default initialization fails and a continue handler is in effect.
If this also fails (out of memory), we have to abort without letting
the handler catch.
Diffstat (limited to 'mysql-test/t/sp.test')
-rw-r--r-- | mysql-test/t/sp.test | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index eaf69c0ab03..edfa09c0e7c 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -4541,6 +4541,50 @@ drop table t3, t4| drop procedure bug14210| set @@session.max_heap_table_size=default| + +# +# BUG#14643: Stored Procedure: Continuing after failed var. initialization +# crashes server. +# +--disable_warnings +drop procedure if exists bug14643_1| +drop procedure if exists bug14643_2| +--enable_warnings + +create procedure bug14643_1() +begin + declare continue handler for sqlexception select 'boo' as 'Handler'; + + begin + declare v int default x; + + if v = 1 then + select 1; + else + select 2; + end if; + end; +end| + +create procedure bug14643_2() +begin + declare continue handler for sqlexception select 'boo' as 'Handler'; + + case x + when 1 then + select 1; + else + select 2; + end case; +end| + +call bug14643_1()| +call bug14643_2()| + +drop procedure bug14643_1| +drop procedure bug14643_2| + + # # BUG#NNNN: New bug synopsis # |