diff options
author | unknown <jani@ua126d19.elisa.omakaista.fi> | 2003-06-05 15:06:19 +0300 |
---|---|---|
committer | unknown <jani@ua126d19.elisa.omakaista.fi> | 2003-06-05 15:06:19 +0300 |
commit | 5bc53e8a3b90820c8856d1b9974246ce939e8e8a (patch) | |
tree | d1f9f9a69bc46be180603ab535afdc1571ae62bd /sql/item_strfunc.cc | |
parent | 280d462ca1646c84f690517ddc8f99848f76ff8f (diff) | |
download | mariadb-git-5bc53e8a3b90820c8856d1b9974246ce939e8e8a.tar.gz |
Fixed a bug in concat_ws(), which did not add concat separator
in case of an empty string. Bug ID 586.
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r-- | sql/item_strfunc.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index ae8bf1dfecb..208be1ecd7f 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -495,18 +495,18 @@ String *Item_func_concat_ws::val_str(String *str) str->length(0); // QQ; Should be removed res=str; - // Skip until non-null and non-empty argument is found. + // Skip until non-null argument is found. // If not, return the empty string for (i=0; i < arg_count; i++) - if ((res= args[i]->val_str(str)) && res->length()) + if ((res= args[i]->val_str(str))) break; if (i == arg_count) return &empty_string; for (i++; i < arg_count ; i++) { - if (!(res2= args[i]->val_str(use_as_buff)) || !res2->length()) - continue; // Skip NULL and empty string + if (!(res2= args[i]->val_str(use_as_buff))) + continue; // Skip NULL if (res->length() + sep_str->length() + res2->length() > current_thd->variables.max_allowed_packet) |