Project

General

Profile

Actions

Bug #7641

open
JF JF

pgsql: can the parser handle multi-statement in simple query

Bug #7641: pgsql: can the parser handle multi-statement in simple query

Added by Juliana Fajardini Reichow about 1 year ago. Updated 5 months ago.

Status:
Assigned
Priority:
Normal
Target version:
Affected Versions:
Effort:
Difficulty:
Label:

Description

According to the protocol specifications, even in SimpleQuery mode/ subprotocol, it is possible to have multiple statements in a Simple Query.
Get some pcaps with this scenario and see how the parser behaves.

(cf https://www.postgresql.org/docs/13/protocol-flow.html#id-1.10.5.7.4)

We'll currently create a new transaction when we receive a SimpleQuery message. But what happens with multiple statements for:
- parsing
- consolidating data, if need be
- logging


Files

TLPW-psql-SimpleQueryCornerCase.pcap (4.42 KB) TLPW-psql-SimpleQueryCornerCase.pcap pcap showcasing 2 queries in a simple query Juliana Fajardini Reichow, 05/06/2025 01:37 PM

JF Updated by Juliana Fajardini Reichow about 1 year ago Actions #1

We do have tests with multiple-statement queries, but still thinking this deserves a review.

JF Updated by Juliana Fajardini Reichow 11 months ago Actions #2

Jason demonstrated that if a simple query message contains two queries, the parser will process the responses as if only one query existed.
Will add an SV soon.

JF Updated by Juliana Fajardini Reichow 10 months ago Actions #4

  • Target version changed from TBD to 9.0.0-beta1

JF Updated by Juliana Fajardini Reichow 5 months ago Actions #5

  • Status changed from New to Assigned
Actions

Also available in: PDF Atom