diff options
author | unknown <evgen@moonbone.local> | 2007-03-10 19:55:34 +0300 |
---|---|---|
committer | unknown <evgen@moonbone.local> | 2007-03-10 19:55:34 +0300 |
commit | 816ea8a379f38d4b38e46d61d23577733a222850 (patch) | |
tree | 5d2667e4ea4f63389e7affb02936eb166ab9304d /mysql-test/r/func_str.result | |
parent | 1631f65dfd757282ac480fd20b3fe7b262f500c5 (diff) | |
download | mariadb-git-816ea8a379f38d4b38e46d61d23577733a222850.tar.gz |
Bug#15757: Wrong SUBSTRING() result when a tmp table was employed.
When the SUBSTRING() function was used over a LONGTEXT field the max_length of
the SUBSTRING() result was wrongly calculated and set to 0. As the 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/t/func_str.test:
Added a test case for the bug#15757: Wrong SUBSTRING() result when a tmp table was employed.
mysql-test/r/func_str.result:
Added a test case for the bug#15757: Wrong SUBSTRING() result when a tmp table was employed.
sql/item_strfunc.cc:
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.
Diffstat (limited to 'mysql-test/r/func_str.result')
-rw-r--r-- | mysql-test/r/func_str.result | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index d09d3aeb529..1ecdea851ce 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -1946,4 +1946,15 @@ NULL 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 +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; End of 5.0 tests |