diff options
author | ram@gw.mysql.r18.ru <> | 2004-06-08 18:01:15 +0500 |
---|---|---|
committer | ram@gw.mysql.r18.ru <> | 2004-06-08 18:01:15 +0500 |
commit | 71eee450e006578f5489e1d999a8c2792777214c (patch) | |
tree | a152aaf558cbcde196313f567fbe97ae284bdf0e /sql/item_strfunc.cc | |
parent | 378653811213bae36f712db2af414bc77b00cb6c (diff) | |
download | mariadb-git-71eee450e006578f5489e1d999a8c2792777214c.tar.gz |
a fix
(Bug #4035 GROUP_CONCAT with HAVING clause truncates field
Bug #4057 LEFT() function in HAVING clause truncates query result).
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r-- | sql/item_strfunc.cc | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 6be9bee438e..864840b726e 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -950,17 +950,10 @@ String *Item_func_left::val_str(String *str) return 0; if (length <= 0) return &my_empty_string; - length= res->charpos(length); - if (res->length() > (ulong) length) - { // Safe even if const arg - if (!res->alloced_length()) - { // Don't change const str - str_value= *res; // Not malloced string - res= &str_value; - } - res->length((uint) length); - } - return res; + if (res->length() <= (uint) length) + return res; + tmp_value.set(*res, 0, res->charpos(length)); + return &tmp_value; } |