MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Alexander Nozdrin Date:April 12 2007 3:42pm
Subject:bk commit into 5.0 tree (anozdrin:1.2438) BUG#5274
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of alik. When alik does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-04-12 19:42:45+04:00, anozdrin@ibm. +2 -0
  Test case for BUG#5274: Stored procedure crash if length
  of CHAR variable too great.

  mysql-test/r/sp.result@stripped, 2007-04-12 19:42:43+04:00, anozdrin@ibm. +50 -0
    Update result file.

  mysql-test/t/sp.test@stripped, 2007-04-12 19:42:43+04:00, anozdrin@ibm. +38 -0
    Add test case for BUG#5274.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	anozdrin
# Host:	ibm.
# Root:	/home/alik/Documents/MySQL/devel/5.0-rt-5274

--- 1.224/mysql-test/r/sp.result	2007-03-27 20:05:14 +04:00
+++ 1.225/mysql-test/r/sp.result	2007-04-12 19:42:43 +04:00
@@ -6053,5 +6053,55 @@
 bug20777(18446744073709551613)+1
 18446744073709551614
 drop function bug20777;
+DROP FUNCTION IF EXISTS bug5274_f1|
+DROP FUNCTION IF EXISTS bug5274_f2|
+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()|
+bug5274_f2()
+x
+Warnings:
+Warning	1265	Data truncated for column 'bug5274_f1' at row 1
+Warning	1265	Data truncated for column 'bug5274_f1' at row 1
+Warning	1265	Data truncated for column 'bug5274_f1' at row 1
+Warning	1265	Data truncated for column 'bug5274_f1' at row 1
+Warning	1265	Data truncated for column 'bug5274_f1' at row 1
+Warning	1265	Data truncated for column 'bug5274_f1' at row 1
+Warning	1265	Data truncated for column 'bug5274_f1' at row 1
+Warning	1265	Data truncated for column 'bug5274_f1' at row 1
+Warning	1265	Data truncated for column 'bug5274_f1' at row 1
+Warning	1265	Data truncated for column 'bug5274_f1' at row 1
+Warning	1265	Data truncated for column 'bug5274_f1' at row 1
+Warning	1265	Data truncated for column 'bug5274_f1' at row 1
+Warning	1265	Data truncated for column 'bug5274_f1' at row 1
+Warning	1265	Data truncated for column 'bug5274_f1' at row 1
+Warning	1265	Data truncated for column 'bug5274_f1' at row 1
+Warning	1265	Data truncated for column 'bug5274_f1' at row 1
+Warning	1265	Data truncated for column 'bug5274_f1' at row 1
+Warning	1265	Data truncated for column 'bug5274_f1' at row 1
+Warning	1265	Data truncated for column 'bug5274_f1' at row 1
+Warning	1265	Data truncated for column 'bug5274_f1' at row 1
+Warning	1265	Data truncated for column 'bug5274_f1' at row 1
+Warning	1265	Data truncated for column 'bug5274_f1' at row 1
+Warning	1265	Data truncated for column 'bug5274_f1' at row 1
+Warning	1265	Data truncated for column 'bug5274_f1' at row 1
+Warning	1265	Data truncated for column 'bug5274_f1' at row 1
+Warning	1265	Data truncated for column 'bug5274_f1' at row 1
+Warning	1265	Data truncated for column 'bug5274_f1' at row 1
+Warning	1265	Data truncated for column 'bug5274_f1' at row 1
+Warning	1265	Data truncated for column 'bug5274_f1' at row 1
+Warning	1265	Data truncated for column 'bug5274_f1' at row 1
+DROP FUNCTION bug5274_f1|
+DROP FUNCTION bug5274_f2|
 End of 5.0 tests.
 drop table t1,t2;

--- 1.214/mysql-test/t/sp.test	2007-03-27 20:05:14 +04:00
+++ 1.215/mysql-test/t/sp.test	2007-04-12 19:42:43 +04:00
@@ -6976,6 +6976,44 @@
 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.
 
Thread
bk commit into 5.0 tree (anozdrin:1.2438) BUG#5274Alexander Nozdrin12 Apr