Bug #2695 | Strange behaviour with GROUP_CONCAT() using ORDER BY | ||
---|---|---|---|
Submitted: | 9 Feb 2004 22:28 | Modified: | 5 Apr 2004 3:20 |
Reporter: | Nate Sanden | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S2 (Serious) |
Version: | 4.1.1-alpha-nt | OS: | Windows (Windows XP) |
Assigned to: | Michael Widenius | CPU Architecture: | Any |
[9 Feb 2004 22:28]
Nate Sanden
[13 Feb 2004 11:12]
Vasily Kishkin
I found the problem. I will fix this bug as soon as possible.
[2 Apr 2004 10:44]
Peter Gulutzan
GROUP_CONCAT(DISTINCT ...) also fails. For example, with MySQL 4.1.2-alpha and SuSE 8.2, I get a result which looks non-distinct: mysql> create table t2 (s1 char(10)); Query OK, 0 rows affected (0.04 sec) mysql> insert into t2 values ('a'),('b'),('c'),('a'); Query OK, 4 rows affected (0.00 sec) Records: 4 Duplicates: 0 Warnings: 0 mysql> select group_concat(distinct s1) from t2; +---------------------------+ | group_concat(distinct s1) | +---------------------------+ | a,c,b,a | +---------------------------+ 1 row in set (0.00 sec)
[3 Apr 2004 13:18]
Vasily Kishkin
The second bug is another bug. Could you insert it like antoher bug message ?
[3 Apr 2004 18:39]
Peter Gulutzan
Okay, I put the report in as a separate error, Bug#3381 Strange behaviour with GROUP_CONCAT() using DISTINCT
[5 Apr 2004 0:18]
Michael Widenius
Will be pushed soon
[5 Apr 2004 3:20]
Michael Widenius
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release. If necessary, you can access the source repository and build the latest available version, including the bugfix, yourself. More information about accessing the source trees is available at http://www.mysql.com/doc/en/Installing_source_tree.html Additional info: Fix will be in 4.1.2 While fixing this, I found a logical bug in how DISTINCT combined with ORDER BY is handled. The current code works only if the ORDER BY uses only all columns in the DISTINCT part. I have for now just documented this issue in the known bugs section in the manual.