mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 20:12:31 +01:00
Test case for BUG#18037: Server crash when returning system
variable in stored procedures.
This commit is contained in:
parent
ab9eadf215
commit
02bacd818d
2 changed files with 76 additions and 0 deletions
|
@ -4960,4 +4960,34 @@ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
|||
DROP FUNCTION bug18589_f1|
|
||||
DROP PROCEDURE bug18589_p1|
|
||||
DROP PROCEDURE bug18589_p2|
|
||||
DROP FUNCTION IF EXISTS bug18037_f1|
|
||||
DROP PROCEDURE IF EXISTS bug18037_p1|
|
||||
DROP PROCEDURE IF EXISTS bug18037_p2|
|
||||
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()|
|
||||
bug18037_f1()
|
||||
1
|
||||
CALL bug18037_p1()|
|
||||
CALL bug18037_p2()|
|
||||
1
|
||||
1
|
||||
DROP FUNCTION bug18037_f1|
|
||||
DROP PROCEDURE bug18037_p1|
|
||||
DROP PROCEDURE bug18037_p2|
|
||||
drop table t1,t2;
|
||||
|
|
|
@ -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
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue