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

Function ClearOrSaveResult

src/bin/psql/common.c:454–473  ·  view source on GitHub ↗

* ClearOrSaveResult * * If the result represents an error, remember it for possible display by * \errverbose. Otherwise, just PQclear() it. * * Note: current policy is to apply this to the results of all queries, * including "back door" queries, for debugging's sake. It's OK to use * PQclear() directly on results known to not be error results, however. */

Source from the content-addressed store, hash-verified

452 * PQclear() directly on results known to not be error results, however.
453 */
454static void
455ClearOrSaveResult(PGresult *result)
456{
457 if (result)
458 {
459 switch (PQresultStatus(result))
460 {
461 case PGRES_NONFATAL_ERROR:
462 case PGRES_FATAL_ERROR:
463 if (pset.last_error_result)
464 PQclear(pset.last_error_result);
465 pset.last_error_result = result;
466 break;
467
468 default:
469 PQclear(result);
470 break;
471 }
472 }
473}
474
475
476/*

Callers 5

PSQLexecFunction · 0.85
PSQLexecWatchFunction · 0.85
SendQueryFunction · 0.85
DescribeQueryFunction · 0.85
ExecQueryUsingCursorFunction · 0.85

Calls 2

PQresultStatusFunction · 0.85
PQclearFunction · 0.85

Tested by

no test coverage detected