From bd8ac900df4d2824f50ce4b1674754685aeaed56 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Fri, 23 Sep 2022 18:21:22 +0200 Subject: Remove PQsendQuery support in pipeline mode The extended query protocol implementation I added in commit acb7e4eb6b1c has bugs when used in pipeline mode. Rather than spend more time trying to fix it, remove that code and make the function rely on simple query protocol only, meaning it can no longer be used in pipeline mode. Users can easily change their applications to use PQsendQueryParams instead. We leave PQsendQuery in place for Postgres 14, just in case somebody is using it and has not hit the mentioned bugs; but we should recommend that it not be used. Backpatch to 15. Per bug report from Gabriele Varrazzo. Discussion: https://postgr.es/m/CA+mi_8ZGSQNmW6-mk_iSR4JZB_LJ4ww3suOF+1vGNs3MrLsv4g@mail.gmail.com --- src/interfaces/libpq/fe-protocol3.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'src/interfaces/libpq/fe-protocol3.c') diff --git a/src/interfaces/libpq/fe-protocol3.c b/src/interfaces/libpq/fe-protocol3.c index f267dfd33c5..0d60e8c5c08 100644 --- a/src/interfaces/libpq/fe-protocol3.c +++ b/src/interfaces/libpq/fe-protocol3.c @@ -284,24 +284,8 @@ pqParseInput3(PGconn *conn) } break; case '2': /* Bind Complete */ - /* Nothing to do for this message type */ - break; case '3': /* Close Complete */ - /* - * If we get CloseComplete when waiting for it, consume - * the queue element and keep going. A result is not - * expected from this message; it is just there so that - * we know to wait for it when PQsendQuery is used in - * pipeline mode, before going in IDLE state. Failing to - * do this makes us receive CloseComplete when IDLE, which - * creates problems. - */ - if (conn->cmd_queue_head && - conn->cmd_queue_head->queryclass == PGQUERY_CLOSE) - { - pqCommandQueueAdvance(conn); - } - + /* Nothing to do for these message types */ break; case 'S': /* parameter status */ if (getParameterStatus(conn)) -- cgit v1.2.3