Skip to content

fix: reject portal based queries in pipeline mode instead of TypeError - #3737

Open
nigrosimone wants to merge 1 commit into
brianc:masterfrom
nigrosimone:reject-portal-queries-in-pipeline
Open

fix: reject portal based queries in pipeline mode instead of TypeError#3737
nigrosimone wants to merge 1 commit into
brianc:masterfrom
nigrosimone:reject-portal-queries-in-pipeline

Conversation

@nigrosimone

@nigrosimone nigrosimone commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

A portal stays open across more round trips. In pipeline mode the queries behind it are written without waiting, so the server answer them out of that portal: the rows go to the wrong query, the next read fails with portal "..." does not exist, and with pg-cursor the process dies with an uncaught TypeError: Cannot read properties of null (reading 'push') inside handleDataRow.

Two cases, both reproducible every time on a client with pipeline: true:

without cursor 1,2,3   (correct)
with cursor:   TypeError: Cannot read properties of null (reading 'push')
               at Cursor.handleDataRow (pg-cursor/index.js:116)

@nigrosimone
nigrosimone force-pushed the reject-portal-queries-in-pipeline branch from 8316f6f to 7e175a8 Compare August 9, 2026 11:58
@nigrosimone
nigrosimone marked this pull request as ready for review August 9, 2026 12:03
@nigrosimone nigrosimone changed the title Reject portal based queries in pipeline mode instead of misrouting rows fix: reject portal based queries in pipeline mode instead of misrouting rows Aug 10, 2026
@nigrosimone nigrosimone changed the title fix: reject portal based queries in pipeline mode instead of misrouting rows fix: reject portal based queries in pipeline mode instead of TypeError Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant