SQLite

View Ticket
Login
Ticket Hash: 55746f9e65f8587c0ad0216e59645255454aad5e
Title: group_concat() returns NULL instead of an empty string
Status: Fixed Type: Code_Defect
Severity: Important Priority: Immediate
Subsystem: Unknown Resolution: Fixed
Last Modified: 2014-05-07 17:19:35
Version Found In: 3.8.4
User Comments:
drh added on 2014-05-07 16:58:28:

The group_concat(x,'') aggregate function returns NULL when all inputs are empty strings. The correct return should be an empty string.

SELECT typeof(group_concat(x,''))
  FROM (SELECT '' AS x UNION ALL SELECT '');

This problem appears to have existed in the code since the group_concat() function was initially added to SQLite in version 3.5.4, 2007-12-14.