1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Fix a problem in the csv extension that was triggered when the very first field in the csv file is zero bytes in size.

FossilOrigin-Name: b12ddabf07b5e06bcee8dda3f990af3a131ab52b8fa969ba061b26d38458f31d
This commit is contained in:
dan
2022-07-05 17:49:04 +00:00
parent 48cae1320b
commit c578e4f0eb
4 changed files with 38 additions and 9 deletions

View File

@ -237,4 +237,26 @@ do_execsql_test 5.4 {
SELECT *, '|' FROM t5_1;
} {1 2 3 4 | one two three four | 5 6 7 8 |}
#-------------------------------------------------------------------------
proc randomtext {n} {
string range [db one {SELECT hex(randomblob($n))}] 1 $n
}
for {set ii 0} {$ii < 200} {incr ii} {
reset_db
load_static_extension db csv
set fd [open csv.data w]
puts $fd "a,b"
puts $fd "[randomtext $ii],abcd"
close $fd
do_execsql_test 6.$ii.1 {
CREATE VIRTUAL TABLE abc USING csv(filename='csv.data', header=true);
}
do_execsql_test 6.$ii.2 {
SELECT count(*) FROM abc
} 1
}
finish_test