From: Date: July 19 2007 6:21pm Subject: bk commit into 5.0 tree (evgen:1.2536) BUG#29850 List-Archive: http://lists.mysql.com/commits/31182 X-Bug: 29850 Message-Id: <20070719162126.B883122CBD9@moonbone.moonbone.local> Below is the list of changes that have just been committed into a local 5.0 repository of evgen. When evgen does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet@stripped, 2007-07-19 20:21:23+04:00, evgen@stripped +3 -0 Bug#29850: Wrong charset of GROUP_CONCAT result when the select employs a temporary table. The result string of the Item_func_group_concat wasn't initialized in the copying constructor of the Item_func_group_concat class. This led to a wrong charset of GROUP_CONCAT result when the select employs a temporary table. The copying constructor of the Item_func_group_concat class now correctly initializes the charset of the result string. mysql-test/r/func_gconcat.result@stripped, 2007-07-19 20:20:41+04:00, evgen@stripped +9 -0 Added a test case for the bug#29850: Wrong charset of the GROUP_CONCAT result when the select employs a temporary table. mysql-test/t/func_gconcat.test@stripped, 2007-07-19 20:20:17+04:00, evgen@stripped +11 -0 Added a test case for the bug#29850: Wrong charset of the GROUP_CONCAT result when the select employs a temporary table. sql/item_sum.cc@stripped, 2007-07-19 20:20:54+04:00, evgen@stripped +1 -0 Bug#29850: Wrong charset of GROUP_CONCAT result when the select employs a temporary table. The copying constructor of the Item_func_group_concat class now correctly initializes the charset of the result string. diff -Nrup a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result --- a/mysql-test/r/func_gconcat.result 2007-05-22 16:48:47 +04:00 +++ b/mysql-test/r/func_gconcat.result 2007-07-19 20:20:41 +04:00 @@ -810,4 +810,13 @@ LENGTH( GROUP_CONCAT( a ) ) 65535 SET group_concat_max_len= DEFAULT; DROP TABLE t1, t2, t3; +set names latin1; +create table t1 (id int, name varchar(20)) DEFAULT CHARSET=utf8; +insert into t1 (id, name) values (1, "óra"); +insert into t1 (id, name) values (2, "óra"); +select b.id, group_concat(b.name) from t1 a, t1 b group by b.id; +id group_concat(b.name) +1 óra,óra +2 óra,óra +drop table t1; End of 5.0 tests diff -Nrup a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test --- a/mysql-test/t/func_gconcat.test 2007-05-22 16:48:47 +04:00 +++ b/mysql-test/t/func_gconcat.test 2007-07-19 20:20:17 +04:00 @@ -551,4 +551,15 @@ SELECT LENGTH( GROUP_CONCAT( a ) ) FROM SET group_concat_max_len= DEFAULT; DROP TABLE t1, t2, t3; +# +# Bug#29850: Wrong charset of the GROUP_CONCAT result when the select employs +# a temporary table. +# +set names latin1; +create table t1 (id int, name varchar(20)) DEFAULT CHARSET=utf8; +insert into t1 (id, name) values (1, "óra"); +insert into t1 (id, name) values (2, "óra"); +select b.id, group_concat(b.name) from t1 a, t1 b group by b.id; +drop table t1; + --echo End of 5.0 tests diff -Nrup a/sql/item_sum.cc b/sql/item_sum.cc --- a/sql/item_sum.cc 2007-07-02 15:21:49 +04:00 +++ b/sql/item_sum.cc 2007-07-19 20:20:54 +04:00 @@ -3068,6 +3068,7 @@ Item_func_group_concat::Item_func_group_ original(item) { quick_group= item->quick_group; + result.set_charset(collation.collation); }