Bug #1362 GROUP_CONCAT returning bad data depending on location in select
Submitted: 20 Sep 2003 17:04 Modified: 23 Sep 2003 13:29
Reporter: Patrick Shoaf Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.1Alpha OS:Linux (Linux x86)
Assigned to: CPU Architecture:Any

[20 Sep 2003 17:04] Patrick Shoaf
Description:
When retrieving data from two tables, GROUP_CONCAT will either return nothing or giberish when GROUP_CONCAT is not first in SELECT statement.

I am attaching a tarred gzip file containg my "mail_order" database directory.  

If only one table is used in SELECT, GROUP_CONCAT will work anywhere.

How to repeat:
The invalid SELECT statement is 

SELECT Cat_Item_Img, Cat_Price, Product.Item_Code, Item_Img,
GROUP_CONCAT(Item_Size SEPARATOR ",") as sizes,
Description, Category, Retail_Price, Short_Desc, Product.Item_Color
FROM Cat_Items, Product WHERE cat_code ="BoltTech" and Cat_Items.Item_Code = Product.Item_Code and Category ="Casual Wear" group by Product.Item_Code

while the working version is 

SELECT GROUP_CONCAT(Item_Size SEPARATOR ",") as sizes, Cat_Item_Img, Cat_Price, Product.Item_Code, Item_Img, Description, Category, Retail_Price, Short_Desc,P roduct.Item_Color FROM Cat_Items,Product WHERE cat_code ="BoltTech" and Cat_Items.Item_Code = Product.Item_Code and Category ="Casual Wear" group by Product.Item_Code
[20 Sep 2003 17:05] Patrick Shoaf
Tar Gzip File containing entire database (full directory)

Attachment: database.tgz (application/x-gzip-compressed, text), 78.08 KiB.

[23 Sep 2003 13:29] Vasily Kishkin
Probably you have the old version of mysql.
[24 Sep 2003 12:48] Patrick Shoaf
I downloaded the rpms from you site the other day.  The files are dated Sep 18 15:xx with minutes varying from 10-16.  Where can I get a more recent version?