Skip to content

fix: skip multi-statement SET validation in session mode#1094

Merged
0 commit merged into
pgdogdev:mainfrom
cschanhniem:main
Jun 22, 2026
Merged

fix: skip multi-statement SET validation in session mode#1094
0 commit merged into
pgdogdev:mainfrom
cschanhniem:main

Conversation

@cschanhniem

Copy link
Copy Markdown

In session mode, PgDog should forward multi-statement queries to the server verbatim without validating whether they mix SET with other commands. The server owns the session and can handle mixed statements natively.

Root cause: try_multi_set() unconditionally rejects any multi-statement query that mixes SET with non-SET statements (e.g., SHOW, SELECT). In session mode this validation is incorrect: there is no logical connection to pool, so mixed SET + other statements are perfectly valid.

Fix: When the pool is in session mode, try_multi_set() returns Ok(None), causing the query to fall through to normal processing and be forwarded to the server as-is.

Example query that was previously rejected but now works:

SET DateStyle='ISO'; SET extra_float_digits = 2; show transaction_isolation

Closed issues: Closes #1087

@cschanhniem

Copy link
Copy Markdown
Author

@CLAassistant signed

@levkk levkk closed this pull request by merging all changes into pgdogdev:main in 415971e Jun 22, 2026
@levkk

levkk commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Not sure what happened here. I think GitHub has yet another bug. I don't think I merged this and it doesn't appear in the git log.

@DirtyRacer1337

Copy link
Copy Markdown

it's right here, you can cherry pick it, 9235234

still actual problem for me

@levkk

levkk commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Could you please resubmit the PR? Thank you and sorry for the trouble.

@DirtyRacer1337

Copy link
Copy Markdown

done #1119

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.

Session mode incorrectly rejects multi-statement queries mixing SET with other commands

3 participants