Skip to content

Commit fcb04ba

Browse files
committed
Fix usage of Data.isdone
1 parent 238ca4f commit fcb04ba

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Sink.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,17 @@ function Data.stream!(source, ::Type{Data.Field}, sink::SQLite.Sink, append::Boo
7777
handle = sink.stmt.handle
7878
transaction(sink.db) do
7979
row = 1
80-
while !Data.isdone(source, row, cols+1)
80+
while true
8181
for col = 1:cols
8282
@inbounds T = types[col]
8383
@inbounds getfield!(source, T, sink.stmt, row, col)
8484
end
8585
SQLite.sqlite3_step(handle)
8686
SQLite.sqlite3_reset(handle)
8787
row += 1
88+
Data.isdone(source, row, cols) && break
8889
end
89-
Data.setrows!(source, rows)
90+
Data.setrows!(source, row - 1)
9091
end
9192
SQLite.execute!(sink.db,"ANALYZE $(esc_id(sink.tablename))")
9293
return sink

0 commit comments

Comments
 (0)