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

Function check_stack_depth

src/backend/tcop/postgres.c:4461–4473  ·  view source on GitHub ↗

* check_stack_depth/stack_is_too_deep: check for excessively deep recursion * * This should be called someplace in any recursive routine that might possibly * recurse deep enough to overflow the stack. Most Unixen treat stack * overflow as an unrecoverable SIGSEGV, so we want to error out ourselves * before hitting the hardware limit. * * check_stack_depth() just throws an error summarily.

Source from the content-addressed store, hash-verified

4459 * can be used by code that wants to handle the error condition itself.
4460 */
4461void
4462check_stack_depth(void)
4463{
4464 if (stack_is_too_deep())
4465 {
4466 ereport(ERROR,
4467 (errcode(ERRCODE_STATEMENT_TOO_COMPLEX),
4468 errmsg("stack depth limit exceeded"),
4469 errhint("Increase the configuration parameter \"max_stack_depth\" (currently %dkB), "
4470 "after ensuring the platform's stack depth limit is adequate.",
4471 max_stack_depth)));
4472 }
4473}
4474
4475bool
4476stack_is_too_deep(void)

Callers 15

makepolFunction · 0.85
executeFunction · 0.85
contains_required_valueFunction · 0.85
findoprndFunction · 0.85
infixFunction · 0.85
int_query_opr_selecFunction · 0.85
makepolFunction · 0.85
findoprndFunction · 0.85
infixFunction · 0.85
ltree_executeFunction · 0.85
checkCondFunction · 0.85
plperl_sv_to_datumFunction · 0.85

Calls 4

stack_is_too_deepFunction · 0.85
errcodeFunction · 0.50
errmsgFunction · 0.50
errhintFunction · 0.50

Tested by

no test coverage detected