From db5f1ea498f736d4ff733bbd41ec649d073cf932 Mon Sep 17 00:00:00 2001 From: Rahim Kanji Date: Tue, 17 Feb 2026 23:45:57 +0500 Subject: [PATCH] Track query count for extended query protocol executions The queries_sent counter in stats.stats_pgsql_connection_pool was not being incremented for prepared statement executions (ASYNC_STMT_EXECUTE_START), only for regular queries (ASYNC_QUERY_START) and statement preparation (ASYNC_STMT_PREPARE_START). --- lib/PgSQL_Connection.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/PgSQL_Connection.cpp b/lib/PgSQL_Connection.cpp index 48dca2bc1..ceb35ea31 100644 --- a/lib/PgSQL_Connection.cpp +++ b/lib/PgSQL_Connection.cpp @@ -750,6 +750,9 @@ handler_again: case ASYNC_STMT_EXECUTE_START: stmt_execute_start(); + __sync_fetch_and_add(&parent->queries_sent, 1); + update_bytes_sent(query.length + 5); + statuses.questions++; if (async_exit_status) { next_event(ASYNC_STMT_EXECUTE_CONT); } else { @@ -808,7 +811,7 @@ handler_again: case ASYNC_RESYNC_START: if (PQpipelineStatus(pgsql_conn) == PQ_PIPELINE_OFF) { - proxy_warning("Resync not required — connection already synchronized.\n"); + proxy_warning("Resync not required - connection already synchronized.\n"); NEXT_IMMEDIATE(ASYNC_RESYNC_END); } resync_start();