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

Function pqSaveWriteError

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

* As above, after appending conn->write_err_msg to whatever other error we * have. This is used when we've detected a write failure and have exhausted * our chances of reporting something else instead. */

Source from the content-addressed store, hash-verified

809 * our chances of reporting something else instead.
810 */
811static void
812pqSaveWriteError(PGconn *conn)
813{
814 /*
815 * If write_err_msg is null because of previous strdup failure, do what we
816 * can. (It's likely our machinations here will get OOM failures as well,
817 * but might as well try.)
818 */
819 if (conn->write_err_msg)
820 {
821 appendPQExpBufferStr(&conn->errorMessage, conn->write_err_msg);
822 /* Avoid possibly appending the same message twice */
823 conn->write_err_msg[0] = '\0';
824 }
825 else
826 appendPQExpBufferStr(&conn->errorMessage,
827 libpq_gettext("write to server failed\n"));
828
829 pqSaveErrorResult(conn);
830}
831
832/*
833 * This subroutine prepares an async result object for return to the caller.

Callers 1

PQgetResultFunction · 0.85

Calls 3

appendPQExpBufferStrFunction · 0.85
libpq_gettextFunction · 0.85
pqSaveErrorResultFunction · 0.85

Tested by

no test coverage detected