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

Function internalerrquery

src/backend/utils/error/elog.c:1559–1576  ·  view source on GitHub ↗

* internalerrquery --- add internal query text to the current error * * Can also pass NULL to drop the internal query text entry. This case * is intended for use in error callback subroutines that are editorializing * on the layout of the error report. */

Source from the content-addressed store, hash-verified

1557 * on the layout of the error report.
1558 */
1559void
1560internalerrquery(const char *query)
1561{
1562 ErrorData *edata = &errordata[errordata_stack_depth];
1563
1564 /* we don't bother incrementing recursion_depth */
1565 CHECK_STACK_DEPTH();
1566
1567 if (edata->internalquery)
1568 {
1569 pfree(edata->internalquery);
1570 edata->internalquery = NULL;
1571 }
1572
1573 if (query)
1574 edata->internalquery = MemoryContextStrdup(edata->assoc_context, query);
1575 errno = edata->saved_errno; /*CDB*/
1576}
1577
1578/*
1579 * err_generic_string -- used to set individual ErrorData string fields

Callers 8

PLy_elog_implFunction · 0.50
import_error_callbackFunction · 0.50
sql_exec_error_callbackFunction · 0.50
_SPI_error_callbackFunction · 0.50

Calls 2

MemoryContextStrdupFunction · 0.85
pfreeFunction · 0.50

Tested by

no test coverage detected