summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <gshchepa/uchum@gleb.loc>2007-07-20 04:04:57 +0500
committerunknown <gshchepa/uchum@gleb.loc>2007-07-20 04:04:57 +0500
commita71eda722a5755c2d4a9cca7b1ad380a5d0d835a (patch)
treef65271a017c12188266a2bbcacba38d65cc23c43
parent39433686e690866bcbf985839b587165ecc91506 (diff)
parentd0020607b324cb9e5c3f930315a4fb0c4a65239b (diff)
downloadmariadb-git-a71eda722a5755c2d4a9cca7b1ad380a5d0d835a.tar.gz
Merge gleb.loc:/home/uchum/work/bk/5.0-opt
into gleb.loc:/home/uchum/work/bk/5.1-opt mysql-test/r/func_gconcat.result: Auto merged mysql-test/t/func_gconcat.test: Auto merged sql/item_sum.cc: Auto merged
-rw-r--r--mysql-test/r/func_gconcat.result9
-rw-r--r--mysql-test/t/func_gconcat.test11
-rw-r--r--sql/item_sum.cc1
3 files changed, 21 insertions, 0 deletions
diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result
index 3fd204c84c9..b17c5e5409c 100644
--- a/mysql-test/r/func_gconcat.result
+++ b/mysql-test/r/func_gconcat.result
@@ -816,4 +816,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 --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test
index b24015ebb99..6f9b5399b7b 100644
--- a/mysql-test/t/func_gconcat.test
+++ b/mysql-test/t/func_gconcat.test
@@ -551,4 +551,15 @@ SELECT LENGTH( GROUP_CONCAT( a ) ) FROM t3 WHERE b = 3;
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 --git a/sql/item_sum.cc b/sql/item_sum.cc
index 0fa46d231a9..8fe843a2a2d 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -3089,6 +3089,7 @@ Item_func_group_concat::Item_func_group_concat(THD *thd,
original(item)
{
quick_group= item->quick_group;
+ result.set_charset(collation.collation);
}