Skip to content

Commit

Permalink
[CSV Reader] Also use figure-out-line code when ignoring errors. (#14184
Browse files Browse the repository at this point in the history
)

Fix: #14177
  • Loading branch information
Mytherin authored Oct 7, 2024
2 parents 405e15f + 18358b5 commit 123b82b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
14 changes: 14 additions & 0 deletions data/csv/auto/14177.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"id","description"
"1","This is a test description for id 1"
"2","This is a test description,
This is a
longer description for id 2"
"3","This is a test description,
This is a
longer description for id 3"
"4","This is a test description,
This is a
longer description for id 4"
"5","This is a test description,
This is a
longer description for id 5"
Original file line number Diff line number Diff line change
Expand Up @@ -1470,10 +1470,6 @@ void StringValueScanner::SetStart() {
}
return;
}
if (state_machine->options.IgnoreErrors()) {
// If we are ignoring errors we don't really need to figure out a line.
return;
}
// The result size of the data after skipping the row is one line
// We have to look for a new line that fits our schema
// 1. We walk until the next new line
Expand Down
11 changes: 11 additions & 0 deletions test/sql/copy/csv/auto/test_14177.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# name: test/sql/copy/csv/auto/test_14177.test
# description: Test CSV Sample works for #14177
# group: [auto]

statement ok
PRAGMA enable_verification

query I
select count(*) FROM (FROM read_csv('data/csv/auto/14177.csv', buffer_size=80, ignore_errors = true)) as t
----
5

0 comments on commit 123b82b

Please sign in to comment.