From c34993b9f60320982dc131577c7480df92c49ae1 Mon Sep 17 00:00:00 2001 From: Guillaume Outters Date: Sat, 5 Oct 2024 15:41:55 +0200 Subject: [PATCH] ext/pdo_pgsql: Fix the condition to close the preceding running statement we shall test if *the last statement* was lazy, not if the *new one* will --- ext/pdo_pgsql/pgsql_statement.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/pdo_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c index b2af41a339b1..5938635eabe5 100644 --- a/ext/pdo_pgsql/pgsql_statement.c +++ b/ext/pdo_pgsql/pgsql_statement.c @@ -258,7 +258,7 @@ static int pgsql_stmt_execute(pdo_stmt_t *stmt) * and returns a PGRES_FATAL_ERROR when PQgetResult gets called for stmt 2 if DEALLOCATE * was called for stmt 1 inbetween * (maybe it will change with pipeline mode in libpq 14?) */ - if (S->is_unbuffered && H->running_stmt) { + if (H->running_stmt && H->running_stmt->is_unbuffered) { pgsql_stmt_finish(H->running_stmt, FIN_CLOSE); H->running_stmt = NULL; }