Repository navigation
Fix downloading a BYTEA cell when the whole result has been fetched. #10906 - #10907
Conversation
…gadmin-org#10906 download_binary_data() restores the cursor position after reading the requested row, but once every row has been read that position is one past the last row, which psycopg refuses to scroll to, so the download failed with "Invalid row/column position.". Restore it by reading the last row instead, leaving the cursor exhausted as it was. Closes pgadmin-org#10906
|
No actionable comments were generated in the recent review. WalkthroughBinary data downloads now restore the cursor position through a helper. Tests cover downloads when zero, one, or three rows have already been read. ChangesBinary download cursor restoration
Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk:
|
Summary
download_binary_data()restored the cursor withscroll(saved_pos, mode='absolute'), but once every row has been read the saved position is one past the last row, which psycopg rejects withIndexError, so the download returned "Invalid row/column position." for any result that fits in the first page.Test plan
utils.driver.psycopg3.tests.test_download_binary_dataagainst PostgreSQL 18 checks the downloaded value and the cursor position afterwards with none, some and all rows read; the all-rows case fails without the fix.Closes #10906
Summary by CodeRabbit