Skip to content

Commit

Permalink
Add better comment, why an additional get_copy_data is done
Browse files Browse the repository at this point in the history
  • Loading branch information
larskanis committed Apr 26, 2023
1 parent 9dc4796 commit c030060
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/pg/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ def copy_data( sql, coder=nil )
raise
else
if coder && res.binary_tuples == 1
# there are two end markers in binary mode: file trailer and the final nil
# There are two end markers in binary mode: file trailer and the final nil.
# The file trailer is expected to be processed by BinaryDecoder::CopyRow and already returns nil, so that the remaining NULL from PQgetCopyData is retrieved here:
if get_copy_data
discard_results
raise PG::NotAllCopyDataRetrieved.new("Not all binary COPY data retrieved", connection: self)
Expand Down

0 comments on commit c030060

Please sign in to comment.