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

Function plpgsql_compile_error_callback

src/pl/plpgsql/src/pl_comp.c:1002–1023  ·  view source on GitHub ↗

* error context callback to let us supply a call-stack traceback. * If we are validating or executing an anonymous code block, the function * source text is passed as an argument. */

Source from the content-addressed store, hash-verified

1000 * source text is passed as an argument.
1001 */
1002static void
1003plpgsql_compile_error_callback(void *arg)
1004{
1005 if (arg)
1006 {
1007 /*
1008 * Try to convert syntax error position to reference text of original
1009 * CREATE FUNCTION or DO command.
1010 */
1011 if (function_parse_error_transpose((const char *) arg))
1012 return;
1013
1014 /*
1015 * Done if a syntax error position was reported; otherwise we have to
1016 * fall back to a "near line N" report.
1017 */
1018 }
1019
1020 if (plpgsql_error_funcname)
1021 errcontext("compilation of PL/pgSQL function \"%s\" near line %d",
1022 plpgsql_error_funcname, plpgsql_latest_lineno());
1023}
1024
1025
1026/*

Callers

nothing calls this directly

Calls 2

plpgsql_latest_linenoFunction · 0.85

Tested by

no test coverage detected