diff options
author | Alexander Barkov <bar@mnogosearch.org> | 2014-04-21 14:22:18 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mnogosearch.org> | 2014-04-21 14:22:18 +0400 |
commit | 31c82360e49ab773f00037796be9f28910baacec (patch) | |
tree | 48dda5e11cc4e1fa0b19a9aecac806d22ce300f5 /sql | |
parent | f5b73fe3f14de97370fa184378de9c27575dceae (diff) | |
parent | 213f10363e1134fdb39842f55876db1136496ff3 (diff) | |
download | mariadb-git-31c82360e49ab773f00037796be9f28910baacec.tar.gz |
Merge from 5.3
Diffstat (limited to 'sql')
-rw-r--r-- | sql/item_strfunc.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 821f9359baf..14f964b3b6d 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1265,7 +1265,7 @@ String *Item_str_conv::val_str(String *str) if (multiply == 1) { uint len; - res= copy_if_not_alloced(str,res,res->length()); + res= copy_if_not_alloced(&tmp_value, res, res->length()); len= converter(collation.collation, (char*) res->ptr(), res->length(), (char*) res->ptr(), res->length()); DBUG_ASSERT(len <= res->length()); @@ -1471,8 +1471,10 @@ void Item_func_substr_index::fix_length_and_dec() String *Item_func_substr_index::val_str(String *str) { DBUG_ASSERT(fixed == 1); + char buff[MAX_FIELD_WIDTH]; + String tmp(buff,sizeof(buff),system_charset_info); String *res= args[0]->val_str(str); - String *delimiter= args[1]->val_str(&tmp_value); + String *delimiter= args[1]->val_str(&tmp); int32 count= (int32) args[2]->val_int(); uint offset; |