From da0048e0b7aa8b5c1657c999183357302d612ccf Mon Sep 17 00:00:00 2001 From: Onder Kalaci Date: Wed, 28 Feb 2018 10:17:20 +0200 Subject: [PATCH] ForgetResults() becomes a wrapper for ClearResults() ClearResults() is able to handle failures properly by checking the result status. So, relying on it makes error handling more generic in Citus. --- .../distributed/connection/remote_commands.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/src/backend/distributed/connection/remote_commands.c b/src/backend/distributed/connection/remote_commands.c index 8999ace4f..2f6ef9de6 100644 --- a/src/backend/distributed/connection/remote_commands.c +++ b/src/backend/distributed/connection/remote_commands.c @@ -65,24 +65,7 @@ IsResponseOK(PGresult *result) void ForgetResults(MultiConnection *connection) { - while (true) - { - PGresult *result = NULL; - const bool dontRaiseErrors = false; - - result = GetRemoteCommandResult(connection, dontRaiseErrors); - if (result == NULL) - { - break; - } - if (PQresultStatus(result) == PGRES_COPY_IN) - { - PQputCopyEnd(connection->pgConn, NULL); - - /* TODO: mark transaction as failed, once we can. */ - } - PQclear(result); - } + ClearResults(connection, false); }