1
0
mirror of https://github.com/MariaDB/server.git synced 2025-09-02 09:41:40 +03:00

Fix for bug#5400 "GROUP_CONCAT returns everything twice":

Don't evaluate the value of GROUP_CONCAT several times for the same 'group', reuse the value instead.
This commit is contained in:
sergefp@mysql.com
2004-09-08 22:43:37 +04:00
parent 0afcaac5a8
commit c8422dfcc7
3 changed files with 20 additions and 0 deletions

View File

@@ -456,3 +456,12 @@ INSERT INTO t1 VALUES (1,2),(2,3),(4,5),(3,5),(1,5),(23,5);
SELECT i, COUNT(DISTINCT(i)) FROM t1 GROUP BY j ORDER BY NULL;
explain SELECT i, COUNT(DISTINCT(i)) FROM t1 GROUP BY j ORDER BY NULL;
DROP TABLE t1;
# Test for BUG#5400: GROUP_CONCAT returns everything twice.
create table t1 ( col1 int, col2 int );
insert into t1 values (1,1),(1,2),(1,3),(2,1),(2,2);
select group_concat( distinct col1 ) as alias from t1
group by col2 having alias like '%';
drop table t1;