sqlean icon indicating copy to clipboard operation
sqlean copied to clipboard

VSV: first row handled incorrectly if contains an empty string

Open mil opened this issue 5 months ago • 1 comments

The vsv extension seems to handle CSV data incorrectly for the first row if there are any empty column values in that row itself.

For example - save as mock_broken.csv:

a,b,c,d
,,,lastcol
foo,bar,baz,bill

and load as:

.load ./vsv
create virtual table tblfoo using vsv(
  header=1,
  filename='mock_broken.csv'
);
.headers on
select * from tblfoo

will yield:

a|b|c|d
lastcol|||
foo|bar|baz|bill

Note that if rows 2/3 are swapped in mock_broken.csv you get the correct result for the row with empty values and the lastcol value is in the 'd' column as it should be. So this is a bug specifically with the first row containing empty values for CSV parsing in the vsv extension.

mil avatar Sep 23 '24 15:09 mil