diff options
author | unknown <ram@gw.mysql.r18.ru> | 2004-09-15 15:13:17 +0500 |
---|---|---|
committer | unknown <ram@gw.mysql.r18.ru> | 2004-09-15 15:13:17 +0500 |
commit | b87892265caf1c88e898eebc3c2f27ad086f6359 (patch) | |
tree | 3d7a323c6cde888ad2a912ad7d129d4063ce78f3 | |
parent | 1afd5d4d3d7fa67ae25afecb129bcc093f61d890 (diff) | |
download | mariadb-git-b87892265caf1c88e898eebc3c2f27ad086f6359.tar.gz |
A fix (bug #5540: CONCAT function and 'double' type).
-rw-r--r-- | mysql-test/r/func_concat.result | 6 | ||||
-rw-r--r-- | mysql-test/t/func_concat.test | 9 | ||||
-rw-r--r-- | sql/item_strfunc.cc | 3 |
3 files changed, 17 insertions, 1 deletions
diff --git a/mysql-test/r/func_concat.result b/mysql-test/r/func_concat.result index 17afd49b54c..ec53d6d87b0 100644 --- a/mysql-test/r/func_concat.result +++ b/mysql-test/r/func_concat.result @@ -26,3 +26,9 @@ FROM t1 GROUP BY new LIMIT 1; number alpha new 1413006 idlfmv 1413006<------------------>idlfmv drop table t1; +create table t1 (a char(4), b double, c date, d tinyint(4)); +insert into t1 values ('AAAA', 105, '2003-03-01', 1); +select * from t1 where concat(A,C,B,D) = 'AAAA2003-03-011051'; +a b c d +AAAA 105 2003-03-01 1 +drop table t1; diff --git a/mysql-test/t/func_concat.test b/mysql-test/t/func_concat.test index 147367a6d27..0cf1502b10e 100644 --- a/mysql-test/t/func_concat.test +++ b/mysql-test/t/func_concat.test @@ -25,3 +25,12 @@ FROM t1 GROUP BY new LIMIT 1; SELECT number, alpha, CONCAT_WS('<------------------>',number,alpha) AS new FROM t1 GROUP BY new LIMIT 1; drop table t1; + +# +# Bug #5540: a problem with double type +# + +create table t1 (a char(4), b double, c date, d tinyint(4)); +insert into t1 values ('AAAA', 105, '2003-03-01', 1); +select * from t1 where concat(A,C,B,D) = 'AAAA2003-03-011051'; +drop table t1; diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index cad1036081e..131bd55dc81 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -289,7 +289,8 @@ String *Item_func_concat::val_str(String *str) str->copy(*res); str->append(*res2); } - res=str; + res= str; + use_as_buff= &tmp_value; } else if (res == &tmp_value) { |