diff options
author | unknown <anozdrin@mysql.com> | 2006-05-18 14:44:15 +0400 |
---|---|---|
committer | unknown <anozdrin@mysql.com> | 2006-05-18 14:44:15 +0400 |
commit | 02bacd818d750c3763e4496692dd577cd790f132 (patch) | |
tree | 6d74403713850dbe045b2739b23f06110c5f28ff /mysql-test/t/sp.test | |
parent | ab9eadf21551e0465ac1523b82741e2fc51621ba (diff) | |
download | mariadb-git-02bacd818d750c3763e4496692dd577cd790f132.tar.gz |
Test case for BUG#18037: Server crash when returning system
variable in stored procedures.
Diffstat (limited to 'mysql-test/t/sp.test')
-rw-r--r-- | mysql-test/t/sp.test | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 9995ff5a9ad..1d21a5da187 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -5844,6 +5844,52 @@ DROP PROCEDURE bug18589_p2| # +# BUG#18037: Server crash when returning system variable in stored procedures +# BUG#19633: Stack corruption in fix_fields()/THD::rollback_item_tree_changes() +# + +# Prepare. + +--disable_warnings +DROP FUNCTION IF EXISTS bug18037_f1| +DROP PROCEDURE IF EXISTS bug18037_p1| +DROP PROCEDURE IF EXISTS bug18037_p2| +--enable_warnings + +# Test case. + +CREATE FUNCTION bug18037_f1() RETURNS INT +BEGIN + RETURN @@server_id; +END| + +CREATE PROCEDURE bug18037_p1() +BEGIN + DECLARE v INT DEFAULT @@server_id; +END| + +CREATE PROCEDURE bug18037_p2() +BEGIN + CASE @@server_id + WHEN -1 THEN + SELECT 0; + ELSE + SELECT 1; + END CASE; +END| + +SELECT bug18037_f1()| +CALL bug18037_p1()| +CALL bug18037_p2()| + +# Cleanup. + +DROP FUNCTION bug18037_f1| +DROP PROCEDURE bug18037_p1| +DROP PROCEDURE bug18037_p2| + + +# # BUG#NNNN: New bug synopsis # #--disable_warnings |