diff options
author | unknown <ram@gw.mysql.r18.ru> | 2004-08-12 11:28:39 +0500 |
---|---|---|
committer | unknown <ram@gw.mysql.r18.ru> | 2004-08-12 11:28:39 +0500 |
commit | a7d2c573f11d928269ee3097edd73b8fd5adae76 (patch) | |
tree | 2b92a251db2b20849710d879b0e4ca177ea15a0b /sql/item_strfunc.cc | |
parent | e21380034c00f3edb0ed0a7a3cfc196cff3c56d2 (diff) | |
download | mariadb-git-a7d2c573f11d928269ee3097edd73b8fd5adae76.tar.gz |
A fix (Bug #4878: Service crashes on query execution)
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r-- | sql/item_strfunc.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index d3493e1fad1..995627766c0 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -984,7 +984,10 @@ String *Item_func_left::val_str(String *str) return &my_empty_string; if (res->length() <= (uint) length) return res; - str_value.set(*res, 0, res->charpos(length)); + if (&str_value == res) + str_value.length(res->charpos(length)); + else + str_value.set(*res, 0, res->charpos(length)); return &str_value; } |