diff options
author | lars/lthalmann@dl145j.mysql.com <> | 2007-07-02 13:22:23 +0200 |
---|---|---|
committer | lars/lthalmann@dl145j.mysql.com <> | 2007-07-02 13:22:23 +0200 |
commit | 6f6492b715db1ead6eff552455588f00aa02eda5 (patch) | |
tree | 8ee2125da71232a26ed66a57f392ac3c0f871768 /sql/item_sum.cc | |
parent | 38deea24964e1acf0920f8dee1a4442531d3ed80 (diff) | |
parent | 3046e8f7385e81354d2d8ab665f5baeb54bd91e6 (diff) | |
download | mariadb-git-6f6492b715db1ead6eff552455588f00aa02eda5.tar.gz |
Merge mysql.com:/nfsdisk1/lars/bkroot/mysql-5.0-rpl
into mysql.com:/nfsdisk1/lars/MERGE/mysql-5.0-merge
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r-- | sql/item_sum.cc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc index e5b0f2721b1..133f00039b0 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -3209,6 +3209,27 @@ Item_func_group_concat::fix_fields(THD *thd, Item **ref) null_value= 1; max_length= thd->variables.group_concat_max_len; + uint32 offset; + if (separator->needs_conversion(separator->length(), separator->charset(), + collation.collation, &offset)) + { + uint32 buflen= collation.collation->mbmaxlen * separator->length(); + uint errors, conv_length; + char *buf; + String *new_separator; + + if (!(buf= thd->stmt_arena->alloc(buflen)) || + !(new_separator= new(thd->stmt_arena->mem_root) + String(buf, buflen, collation.collation))) + return TRUE; + + conv_length= copy_and_convert(buf, buflen, collation.collation, + separator->ptr(), separator->length(), + separator->charset(), &errors); + new_separator->length(conv_length); + separator= new_separator; + } + if (check_sum_func(thd, ref)) return TRUE; |