From de20402c10bce9003024023c570ab10aff77051f Mon Sep 17 00:00:00 2001 From: Rahim Kanji Date: Mon, 12 Aug 2024 12:22:04 +0500 Subject: [PATCH] Process all data in the buffer before receiving additional data from the socket --- lib/PgSQL_Connection.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/PgSQL_Connection.cpp b/lib/PgSQL_Connection.cpp index 9b7378e4c..61407bd32 100644 --- a/lib/PgSQL_Connection.cpp +++ b/lib/PgSQL_Connection.cpp @@ -2132,6 +2132,12 @@ void PgSQL_Connection::fetch_result_cont(short event) { if (pgsql_result) return; + // we already have data available in buffer + if (PQisBusy(pgsql_conn) == 0) { + pgsql_result = PQgetResult(pgsql_conn); + return; + } + if (PQconsumeInput(pgsql_conn) == 0) { // WARNING: DO NOT RELEASE this PGresult const PGresult* result = PQgetResultFromPGconn(pgsql_conn);