From 52758f7cd8b6d6ba9e4a652d87f142af5bda6697 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 30 Aug 2005 15:36:47 +0500 Subject: Bug #12829 Cannot convert the charset of a GROUP_CONCAT result: item_sum.cc: "result" character set was not set into proper value. func_gconcat.result, func_gconcat.test: Fixing tests accordingly. sql/item_sum.cc: Bug #12829 Cannot convert the charset of a GROUP_CONCAT result: "result" character set was not set into proper value. mysql-test/t/func_gconcat.test: Bug #12829 mysql-test/r/func_gconcat.result: Bug #12829 --- mysql-test/r/func_gconcat.result | 9 +++++++++ mysql-test/t/func_gconcat.test | 10 ++++++++++ sql/item_sum.cc | 1 + 3 files changed, 20 insertions(+) diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index 9faee3cbc01..ca615e28823 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -469,6 +469,15 @@ select collation(group_concat(a,b)) from t1; ERROR HY000: Illegal mix of collations (cp1250_general_ci,IMPLICIT) and (koi8r_general_ci,IMPLICIT) for operation 'group_concat' drop table t1; drop table t2; +CREATE TABLE t1 (a CHAR(10) CHARACTER SET cp850); +INSERT INTO t1 VALUES ('À'); +SELECT a FROM t1; +a +À +SELECT GROUP_CONCAT(a) FROM t1; +GROUP_CONCAT(a) +À +DROP TABLE t1; CREATE TABLE t1 (id int); SELECT GROUP_CONCAT(id) AS gc FROM t1 HAVING gc IS NULL; gc diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test index 9793d0d0a2c..3fa72b364d9 100644 --- a/mysql-test/t/func_gconcat.test +++ b/mysql-test/t/func_gconcat.test @@ -281,6 +281,16 @@ select collation(group_concat(a,b)) from t1; drop table t1; drop table t2; +# +# Bug #12829 +# Cannot convert the charset of a GROUP_CONCAT result +# +CREATE TABLE t1 (a CHAR(10) CHARACTER SET cp850); +INSERT INTO t1 VALUES ('À'); +SELECT a FROM t1; +SELECT GROUP_CONCAT(a) FROM t1; +DROP TABLE t1; + # # bug #7769: group_concat returning null is checked in having # diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 74a7fee113e..cb4107c4276 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -1937,6 +1937,7 @@ Item_func_group_concat::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) args, arg_count, MY_COLL_ALLOW_CONV)) return 1; + result.set_charset(collation.collation); result_field= 0; null_value= 1; max_length= group_concat_max_len; -- cgit v1.2.1