Below is the list of changes that have just been committed into a local
5.0 repository of evgen. When evgen 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-03-09 19:44:13+03:00, evgen@stripped +3 -0
Bug#15757: Wrong SUBSTRING() result when a tmp table was employed.
When the SUBSTRING() function used over a LONGTEXT field the max_length of
the SUBSTRING() result was wrongly calculated and set to 0. Due to max_length
parameter is used while tmp field creation it limits the length of the result
field and leads to printing an empty string instead of the correct result.
Now the Item_func_substr::fix_length_and_dec() function correctly calculates
the max_length parameter.
mysql-test/r/func_str.result@stripped, 2007-03-09 19:43:31+03:00, evgen@stripped +7 -0
Added a test case for the bug#15757: Wrong SUBSTRING() result when a tmp table was employed.
mysql-test/t/func_str.test@stripped, 2007-03-09 19:43:00+03:00, evgen@stripped +8 -0
Added a test case for the bug#15757: Wrong SUBSTRING() result when a tmp table was employed.
sql/item_strfunc.cc@stripped, 2007-03-09 19:43:43+03:00, evgen@stripped +1 -1
Bug#15757: Wrong SUBSTRING() result when a tmp table was employed.
Now the Item_func_substr::fix_length_and_dec() function correctly calculates
the max_length parameter.
# 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: evgen
# Host: moonbone.local
# Root: /mnt/gentoo64/work/15757-bug-5.0-opt-mysql
--- 1.295/sql/item_strfunc.cc 2007-02-21 14:05:00 +03:00
+++ 1.296/sql/item_strfunc.cc 2007-03-09 19:43:43 +03:00
@@ -1185,7 +1185,7 @@
{
int32 start= (int32) args[1]->val_int();
start= (int32)((start < 0) ? max_length + start : start - 1);
- if (start < 0 || start >= (int32) max_length)
+ if (start < 0 || (uint32)start >= max_length)
max_length=0; /* purecov: inspected */
else
max_length-= (uint) start;
--- 1.127/mysql-test/r/func_str.result 2007-03-02 13:14:49 +03:00
+++ 1.128/mysql-test/r/func_str.result 2007-03-09 19:43:31 +03:00
@@ -1946,4 +1946,11 @@
SELECT UNHEX('G') IS NULL;
UNHEX('G') IS NULL
1
+create table t1(f1 longtext);
+insert into t1 values ("123"),("456");
+select substring(f1,1,1) from t1 group by 1;
+substring(f1,1,1)
+1
+4
+drop table t1;
End of 5.0 tests
--- 1.100/mysql-test/t/func_str.test 2007-03-02 13:14:49 +03:00
+++ 1.101/mysql-test/t/func_str.test 2007-03-09 19:43:00 +03:00
@@ -1014,4 +1014,12 @@
SELECT UNHEX('G');
SELECT UNHEX('G') IS NULL;
+#
+# Bug#15757: Wrong SUBSTRING() result when a tmp table was employed.
+#
+create table t1(f1 longtext);
+insert into t1 values ("123"),("456");
+select substring(f1,1,1) from t1 group by 1;
+drop table t1;
+
--echo End of 5.0 tests
| Thread |
|---|
| • bk commit into 5.0 tree (evgen:1.2435) BUG#15757 | eugene | 9 Mar |