mirror of https://github.com/citusdata/citus.git
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
parent
76f6883d5d
commit
da0048e0b7
|
@ -65,24 +65,7 @@ IsResponseOK(PGresult *result)
|
||||||
void
|
void
|
||||||
ForgetResults(MultiConnection *connection)
|
ForgetResults(MultiConnection *connection)
|
||||||
{
|
{
|
||||||
while (true)
|
ClearResults(connection, false);
|
||||||
{
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue