Skip to content

fix(pg): run a named statement with an empty text more than once - #3781

Open
nigrosimone wants to merge 3 commits into
brianc:masterfrom
nigrosimone:fix-named-empty-statement
Open

nigrosimone wants to merge 3 commits into
brianc:masterfrom
nigrosimone:fix-named-empty-statement

Conversation

@nigrosimone

@nigrosimone nigrosimone commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

client.query({ text: '', name: 'empty' }) works once and fails from the second run on with prepared statement "empty" already exists. On ParseComplete the client records the name with its text, '', and hasBeenParsed then tests that text for truth, so the statement is read as never parsed and is sent to Parse again. The native client keeps its own map of names and reads it the same way.

The fix checks both caches by presence rather than by the truth of the text.

The added test runs a named empty statement twice: it fails on master, on both clients, and passes here.

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