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-10 19:57:18+03:00, evgen@stripped +3 -0
Merge moonbone.local:/mnt/gentoo64/work/15757-bug-5.0-opt-mysql
into moonbone.local:/mnt/gentoo64/work/25373-bug-5.0-opt-mysql
MERGE: 1.2413.35.1
mysql-test/r/func_str.result@stripped, 2007-03-10 19:57:17+03:00, evgen@stripped +0
-0
SCCS merged
MERGE: 1.126.3.1
mysql-test/t/func_str.test@stripped, 2007-03-10 19:57:17+03:00, evgen@stripped +0 -0
SCCS merged
MERGE: 1.99.2.1
sql/item_strfunc.cc@stripped, 2007-03-10 19:56:09+03:00, evgen@stripped +0 -0
Auto merged
MERGE: 1.295.2.1
# 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/25373-bug-5.0-opt-mysql/RESYNC
--- 1.297/sql/item_strfunc.cc 2007-03-09 14:03:01 +03:00
+++ 1.298/sql/item_strfunc.cc 2007-03-10 19:56:09 +03:00
@@ -1184,11 +1184,10 @@
if (args[1]->const_item())
{
int32 start= (int32) args[1]->val_int();
- start= (int32)((start < 0) ? max_length + start : start - 1);
- if (start < 0 || start >= (int32) max_length)
- max_length=0; /* purecov: inspected */
+ if (start < 0)
+ max_length= ((uint)(-start) > max_length) ? 0 : (uint)(-start);
else
- max_length-= (uint) start;
+ max_length-= min((uint)(start - 1), max_length);
}
if (arg_count == 3 && args[2]->const_item())
{
--- 1.130/mysql-test/r/func_str.result 2007-03-10 19:50:55 +03:00
+++ 1.131/mysql-test/r/func_str.result 2007-03-10 19:57:17 +03:00
@@ -1940,6 +1940,17 @@
select lpad('abc', cast(5 as unsigned integer), 'x');
lpad('abc', cast(5 as unsigned integer), 'x')
xxabc
+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
+create table t2(f1 varchar(3));
+insert into t1 values ("123"),("456");
+select substring(f1,4,1), substring(f1,-4,1) from t2;
+substring(f1,4,1) substring(f1,-4,1)
+drop table t1,t2;
DROP TABLE IF EXISTS t1;
CREATE TABLE `t1` (
`id` varchar(20) NOT NULL,
--- 1.102/mysql-test/t/func_str.test 2007-03-09 14:05:40 +03:00
+++ 1.103/mysql-test/t/func_str.test 2007-03-10 19:57:17 +03:00
@@ -1009,6 +1009,17 @@
select lpad('abc', cast(5 as unsigned integer), 'x');
#
+# 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;
+create table t2(f1 varchar(3));
+insert into t1 values ("123"),("456");
+select substring(f1,4,1), substring(f1,-4,1) from t2;
+drop table t1,t2;
+
+#
# Bug #25197 :repeat function returns null when using table field directly as count
#
| Thread |
|---|
| • bk commit into 5.0 tree (evgen:1.2474) | eugene | 12 Mar |