libpq: Reset singlerow flag correctly in pipeline mode
authorAlvaro Herrera <[email protected]>
Fri, 14 Oct 2022 17:06:26 +0000 (19:06 +0200)
committerAlvaro Herrera <[email protected]>
Fri, 14 Oct 2022 17:06:26 +0000 (19:06 +0200)
commitb8af4166ff96af9c7bed1b511d0356284a8b7766
treec84cbc4282b9255612c991e27cf2818f64ec41cb
parent3fe6f261f7a20cfc8e6809ae36bfe93d1f779751
libpq: Reset singlerow flag correctly in pipeline mode

When a query whose results were requested in single-row mode is the last
in the queue by the time those results are being read, the single-row
flag was not being reset, because we were returning early from
pqPipelineProcessQueue.  Move that stanza up so that the flag is always
reset at the end of sending that query's results.

Add a test for the situation.

Backpatch to 14.

Author: Denis Laxalde <[email protected]>
Discussion: https://postgr.es/m/01af18c5-dacc-a8c8-07ee-aecc7650c3e8@dalibo.com
src/interfaces/libpq/fe-exec.c
src/test/modules/libpq_pipeline/libpq_pipeline.c
src/test/modules/libpq_pipeline/traces/singlerow.trace