View Ticket
Not logged in
Ticket Hash: 05a0499f22c12b177c8a8aca0a52d906d7bed8ca
Title: Duplicate values printed in spatialite CLI column output
Status: Open Type: Code_Defect
Severity: Critical Priority: Immediate
Subsystem: Resolution: Open
Last Modified: 2026-03-04 12:16:04
Version Found In: 3.51.2
User Comments:
anonymous added on 2026-03-04 12:09:19:

On Spatialite 3.41.2, run the following:

$ spatialite -header -column :memory: "select 'foo', 'bar', 'baz';" 2>/dev/null | sed -n "/^'/,\$p"
'foo'       'bar'       'baz'
----------  ----------  ----------
foo         foo         bar         bar         baz
baz

You can see from this output that each of 'foo', 'bar', and 'baz' appear twice. I would expect instead, to see this:

$ spatialite -header -column :memory: "select 'foo', 'bar', 'baz';" 2>/dev/null | sed -n "/^'/,\$p"
'foo'       'bar'       'baz'
----------  ----------  ----------
foo         bar         baz

I've tracked this bug down to the addition of lines 1232-1233 in https://www.gaia-gis.it/fossil/spatialite-tools/info/21959bb1fc1332cb, which adds a duplicate of the subsequent fprintf call, thus printing each value twice.

It'd be great for these 2 lines to be removed to make column output usable for the first time in 14 years. :)


anonymous added on 2026-03-04 12:16:04:

On Spatialite 3.51.2, run the following:

$ spatialite -header -column :memory: "select 'foo', 'bar', 'baz';" 2>/dev/null | sed -n "/^'/,\$p"
'foo'       'bar'       'baz'
----------  ----------  ----------
foo         foo         bar         bar         baz
baz

You can see from this output that each of 'foo', 'bar', and 'baz' appear twice. I would expect instead, to see this:

$ spatialite -header -column :memory: "select 'foo', 'bar', 'baz';" 2>/dev/null | sed -n "/^'/,\$p"
'foo'       'bar'       'baz'
----------  ----------  ----------
foo         bar         baz

I've tracked this bug down to the addition of lines 1232-1233 in https://www.gaia-gis.it/fossil/spatialite-tools/info/21959bb1fc1332cb, which adds a duplicate of the subsequent fprintf call, thus printing each value twice.

It'd be great for these 2 lines to be removed to make column output usable for the first time in 14 years. :)