1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Test case for BUG#18037: Server crash when returning system

variable in stored procedures.
This commit is contained in:
anozdrin@mysql.com
2006-05-18 14:44:15 +04:00
parent 1e6c14d687
commit 6699f81cc1
2 changed files with 76 additions and 0 deletions

View File

@ -5843,6 +5843,52 @@ DROP PROCEDURE bug18589_p1|
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
#