From d877cdf3e7fa6c176a2dea418deaa0bb2d9500ff Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 6 Sep 2005 22:20:11 -0700 Subject: func_gconcat.result, func_gconcat.test: Added test cases for bug #12863. item_sum.cc, item_sum.h: Fixed bug #12863. Added a flag to Item_func_group_concat set to FALSE after concatenation of the first element of a group. sql/item_sum.h: Fixed bug #12863. Added a flag to Item_func_group_concat set to FALSE after concatenation of the first element of a group. sql/item_sum.cc: Fixed bug #12863. Added a flag to Item_func_group_concat set to FALSE after concatenation of the first element of a group. mysql-test/t/func_gconcat.test: Added test cases for bug #12863. mysql-test/r/func_gconcat.result: Added test cases for bug #12863. --- mysql-test/t/func_gconcat.test | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'mysql-test/t/func_gconcat.test') diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test index 9e003d19ab9..aa8ce0f4bdc 100644 --- a/mysql-test/t/func_gconcat.test +++ b/mysql-test/t/func_gconcat.test @@ -356,4 +356,20 @@ select * from (select group_concat(a) from t1) t2; select group_concat('x') UNION ALL select 1; drop table t1; +# +# Bug #12863 : missing separators after first empty cancatanated elements +# + +CREATE TABLE t1 (id int, a varchar(9)); +INSERT INTO t1 VALUES + (2, ''), (1, ''), (2, 'x'), (1, 'y'), (3, 'z'), (3, ''); + +SELECT GROUP_CONCAT(a) FROM t1; +SELECT GROUP_CONCAT(a ORDER BY a) FROM t1; + +SELECT GROUP_CONCAT(a) FROM t1 GROUP BY id; +SELECT GROUP_CONCAT(a ORDER BY a) FROM t1 GROUP BY id; + +DROP TABLE t1; + # End of 4.1 tests -- cgit v1.2.1