SQLite

View Ticket
Login
2014-05-07
18:23
Make sure the group_concat() function returns an empty string, not a NULL, if it has at least one input row. Fix for ticket [55746f9e65f8587]. (check-in: d01cedaa user: drh tags: trunk)
17:19 Fixed ticket [55746f9e]: group_concat() returns NULL instead of an empty string plus 5 other changes (artifact: 63c1dfcf user: drh)
17:19
Make sure the group_concat() function returns an empty string, not a NULL, if it has at least one input row. Fix for ticket [55746f9e65f8587]. (check-in: 0deac873 user: drh tags: tkt-55746f9e)
16:58 New ticket [55746f9e] group_concat() returns NULL instead of an empty string. (artifact: cc9c07bc user: drh)

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.