MariaDB GROUP_CONCAT only returns one value

I'm having a weird problem with the GROUP_CONCAT function on my instance where using it to group integers works fine, but applying it to varchar doesn't work at all.

The data goes along the lines:

CUSTOMERID  LOCATIONNAME    PRODUCTID   UNITS   ID  PRODUCTNAME
1           Location            65       100    1   Product 65
1           Location            66       100    2   Product 66
1           Location            67       100    3   Product 67
1           Location            68       100    4   Product 68
1           Location            68       100    5   Product 68

      

When I run: SELECT GROUP_CONCAT(DISTINCT lm.ProductID) as Brand FROM locationMap lm WHERE (lm.CustomerID = 1);

It returns 65, 66, 67, 68 and works correctly.

When I run: SELECT GROUP_CONCAT(DISTINCT lm.ProductName) as Brand FROM locationMap lm WHERE (lm.CustomerID = 1);

It only returns the first item (product 65).

I installed a SQL script ( http://www.sqlfiddle.com/#!2/2392f/3 ) to test it and everything works correctly there. Can anyone suggest a suggestion on what might be wrong in my environment that might be causing this? I am running 5.5.30-MariaDB-30.1

+3


source to share


1 answer


Make sure that upgrading the server from 5.5.30-MariaDB-30.1 to 5.5.38-MariaDB-35.2 resolved the issue. Thanks everyone for their suggestions.



+2


source







All Articles