Bug #3381 Strange behaviour with GROUP_CONCAT() using DISTINCT
Submitted: 3 Apr 2004 18:38 Modified: 5 Apr 2004 3:21
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.2-alpha--debug OS:Linux (SuSE 8.2)
Assigned to: Michael Widenius CPU Architecture:Any

[3 Apr 2004 18:38] Peter Gulutzan
Description:
GROUP_CONCAT(DISTINCT ...) fails, the result is non-distinct. I originally thought there 
might be a connection with BUG##2695  Strange behaviour with GROUP_CONCAT() using 
ORDER BY. But we will now consider it a separate bug. 
 
 

How to repeat:
 
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)
[5 Apr 2004 3:21] 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
See #2695 for details