Bug #5827 DISTINCT not being processed in GROUP_CONCAT
Submitted: 30 Sep 2004 15:42 Modified: 1 Oct 2004 2:50
Reporter: Daniel Ide Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Query Browser Severity:S3 (Non-critical)
Version:4.1 OS:Windows (Windows 2000 Server)
Assigned to: CPU Architecture:Any

[30 Sep 2004 15:42] Daniel Ide
Description:
I'm using the GROUP_CONCAT function with the DISTINCT modifier in it. Most of the time, the function works as it is supposed to do.
But sometimes (maybe 1 out of 50 times) the result ist just as DISTINCT wasn't processed (i.e. I get the string "Name, Name, Name, Name, Name, ..." instead of "Name").

How to repeat:
Create a table named 'Node', fields 'NodeID', 'Node_Name', 'GroupID'.

Fill it with data. Take care, that the GroupIDs are not Unique, but repeat often (maybe 5 GroupIDs for 100 nodes)

Run this SQL-Statement and enjoy the result:

SELECT group_concat( DISTINCT node_name separator ', ' ) 
FROM node
GROUP BY groupid