SQLite User Forum

bug report: concat_ws() omits blank strings
Login

bug report: concat_ws() omits blank strings

(1) By vafylec on 2025-06-10 23:38:02 [source]

In MySQL/PostgreSQL:
SELECT concat_ws('|', 'a', '', 'b', NULL, 'c'); returns 'a||b|c'.

In SQLite (v3.44-v3.50.1):
SELECT concat_ws('|', 'a', '', 'b', NULL, 'c'); returns 'a|b|c'.

This appears to be a bug.
It correctly omits nulls.
It incorrectly omits blank strings.

The documentation states:

The concat_ws(SEP,...) function returns a string that is the concatenation of all non-null arguments beyond the first argument, using the text value of the first argument as a separator.

My bold.

Many thanks for SQLite, one of my favourite (I'm British) and most-used pieces of software!

(2) By Richard Hipp (drh) on 2025-06-11 00:03:42 in reply to 1 [link] [source]

Fixed at check-in 2025-06-11T00:01Z. Thanks for the report.