summaryrefslogtreecommitdiff
path: root/mysql-test/t/sp.test
diff options
context:
space:
mode:
authorkostja@vajra.(none) <>2007-04-14 18:35:09 -0400
committerkostja@vajra.(none) <>2007-04-14 18:35:09 -0400
commit4eeee57c4b9d0c522e65396cf0b447e8772ce985 (patch)
treef2db78223681cb00464efe8df408cda0b2c4cc6c /mysql-test/t/sp.test
parente0f0ba802fc22591eac1100945c3dce93941a06d (diff)
parent58823d3bdd50e086dc5dcdfea02a23e5183b65e6 (diff)
downloadmariadb-git-4eeee57c4b9d0c522e65396cf0b447e8772ce985.tar.gz
Merge vajra.(none):/opt/local/work/mysql-5.0-runtime
into vajra.(none):/opt/local/work/mysql-5.1-runtime
Diffstat (limited to 'mysql-test/t/sp.test')
-rw-r--r--mysql-test/t/sp.test38
1 files changed, 38 insertions, 0 deletions
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index f776be40864..4067003d35c 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -7068,6 +7068,44 @@ select bug20777(18446744073709551613)+1;
drop function bug20777;
delimiter |;
+
+#
+# BUG#5274: Stored procedure crash if length of CHAR variable too great.
+#
+
+# Prepare.
+
+--disable_warnings
+DROP FUNCTION IF EXISTS bug5274_f1|
+DROP FUNCTION IF EXISTS bug5274_f2|
+--enable_warnings
+
+# Test.
+
+CREATE FUNCTION bug5274_f1(p1 CHAR) RETURNS CHAR
+ RETURN CONCAT(p1, p1)|
+
+CREATE FUNCTION bug5274_f2() RETURNS CHAR
+BEGIN
+ DECLARE v1 INT DEFAULT 0;
+ DECLARE v2 CHAR DEFAULT 'x';
+
+ WHILE v1 < 30 DO
+ SET v1 = v1 + 1;
+ SET v2 = bug5274_f1(v2);
+ END WHILE;
+
+ RETURN v2;
+END|
+
+SELECT bug5274_f2()|
+
+# Cleanup.
+
+DROP FUNCTION bug5274_f1|
+DROP FUNCTION bug5274_f2|
+
+
###
--echo End of 5.0 tests.