pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix libpq state machine in pipeline mode
2+ messages / 1 participants
[nested] [flat]

* pgsql: Fix libpq state machine in pipeline mode
@ 2021-06-29 19:06  Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Alvaro Herrera @ 2021-06-29 19:06 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix libpq state machine in pipeline mode

The original coding required that PQpipelineSync had been called before
the first call to PQgetResult, and failure to do that would result in an
unexpected NULL result being returned.  Fix by setting the right state
when a query is sent, rather than leaving it unchanged and having
PQpipelineSync apply the necessary state change.

A new test case to verify the behavior is added, which relies on the new
PQsendFlushRequest() function added by commit a7192326c74d.

Backpatch to 14, where pipeline mode was added.

Reported-by: Boris Kolpackov <boris@codesynthesis.com>
Author: Álvaro Herrera <alvherre@alvh.no-ip.org>
Discussion: https://postgr.es/m/boris.20210616110321@codesynthesis.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b71a9cb31e46b08aeac35a4355936165648b3c49

Modified Files
--------------
src/interfaces/libpq/fe-exec.c                     | 19 ++---
src/test/modules/libpq_pipeline/libpq_pipeline.c   | 90 +++++++++++++++++++++
.../modules/libpq_pipeline/t/001_libpq_pipeline.pl |  2 +-
.../modules/libpq_pipeline/traces/nosync.trace     | 92 ++++++++++++++++++++++
4 files changed, 188 insertions(+), 15 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Fix libpq state machine in pipeline mode
@ 2021-06-29 19:06  Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Alvaro Herrera @ 2021-06-29 19:06 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix libpq state machine in pipeline mode

The original coding required that PQpipelineSync had been called before
the first call to PQgetResult, and failure to do that would result in an
unexpected NULL result being returned.  Fix by setting the right state
when a query is sent, rather than leaving it unchanged and having
PQpipelineSync apply the necessary state change.

A new test case to verify the behavior is added, which relies on the new
PQsendFlushRequest() function added by commit a7192326c74d.

Backpatch to 14, where pipeline mode was added.

Reported-by: Boris Kolpackov <boris@codesynthesis.com>
Author: Álvaro Herrera <alvherre@alvh.no-ip.org>
Discussion: https://postgr.es/m/boris.20210616110321@codesynthesis.com

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/690339fcd58759d213523f87071f992c4402e980

Modified Files
--------------
src/interfaces/libpq/fe-exec.c                     | 19 ++---
src/test/modules/libpq_pipeline/libpq_pipeline.c   | 90 +++++++++++++++++++++
.../modules/libpq_pipeline/t/001_libpq_pipeline.pl |  2 +-
.../modules/libpq_pipeline/traces/nosync.trace     | 92 ++++++++++++++++++++++
4 files changed, 188 insertions(+), 15 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2021-06-29 19:06 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-06-29 19:06 pgsql: Fix libpq state machine in pipeline mode Alvaro Herrera <alvherre@alvh.no-ip.org>
2021-06-29 19:06 pgsql: Fix libpq state machine in pipeline mode Alvaro Herrera <alvherre@alvh.no-ip.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox