* 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. */
| 1557 | * on the layout of the error report. |
| 1558 | */ |
| 1559 | void |
| 1560 | internalerrquery(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 |
no test coverage detected