MCPcopy Create free account
hub / github.com/apache/cloudberry / pqPrepareAsyncResult

Function pqPrepareAsyncResult

src/interfaces/libpq/fe-exec.c:838–862  ·  view source on GitHub ↗

* This subroutine prepares an async result object for return to the caller. * If there is not already an async result object, build an error object * using whatever is in conn->errorMessage. In any case, clear the async * result storage. */

Source from the content-addressed store, hash-verified

836 * result storage.
837 */
838PGresult *
839pqPrepareAsyncResult(PGconn *conn)
840{
841 PGresult *res;
842
843 /*
844 * conn->result is the PGresult to return. If it is NULL (which probably
845 * shouldn't happen) we assume there is an appropriate error message in
846 * conn->errorMessage.
847 */
848 res = conn->result;
849 if (!res)
850 res = PQmakeEmptyPGresult(conn, PGRES_FATAL_ERROR);
851
852 /*
853 * Replace conn->result with next_result, if any. In the normal case
854 * there isn't a next result and we're just dropping ownership of the
855 * current result. In single-row mode this restores the situation to what
856 * it was before we created the current single-row result.
857 */
858 conn->result = conn->next_result;
859 conn->next_result = NULL;
860
861 return res;
862}
863
864/*
865 * pqInternalNotice - produce an internally-generated notice message

Callers 3

pqFunctionCall3Function · 0.85
PQgetResultFunction · 0.85
getCopyResultFunction · 0.85

Calls 1

PQmakeEmptyPGresultFunction · 0.85

Tested by

no test coverage detected