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.
pull/2031/head
Onder Kalaci 2018-02-28 10:17:20 +02:00
parent 76f6883d5d
commit da0048e0b7
1 changed files with 1 additions and 18 deletions

View File

@ -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);
}