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

Function make_parsestate

src/backend/parser/parse_node.c:43–70  ·  view source on GitHub ↗

* make_parsestate * Allocate and initialize a new ParseState. * * Caller should eventually release the ParseState via free_parsestate(). */

Source from the content-addressed store, hash-verified

41 * Caller should eventually release the ParseState via free_parsestate().
42 */
43ParseState *
44make_parsestate(ParseState *parentParseState)
45{
46 ParseState *pstate;
47
48 pstate = palloc0(sizeof(ParseState));
49
50 pstate->parentParseState = parentParseState;
51
52 /* Fill in fields that don't start at null/false/zero */
53 pstate->p_next_resno = 1;
54 pstate->p_resolve_unknowns = true;
55
56 if (parentParseState)
57 {
58 pstate->p_sourcetext = parentParseState->p_sourcetext;
59 /* all hooks are copied from parent */
60 pstate->p_pre_columnref_hook = parentParseState->p_pre_columnref_hook;
61 pstate->p_post_columnref_hook = parentParseState->p_post_columnref_hook;
62 pstate->p_paramref_hook = parentParseState->p_paramref_hook;
63 pstate->p_coerce_param_hook = parentParseState->p_coerce_param_hook;
64 pstate->p_ref_hook_state = parentParseState->p_ref_hook_state;
65 /* query environment stays in context for the whole parse analysis */
66 pstate->p_queryEnv = parentParseState->p_queryEnv;
67 }
68
69 return pstate;
70}
71
72/*
73 * free_parsestate

Callers 15

appendLimitClauseFunction · 0.85
rewriteTargetViewFunction · 0.85
standard_ProcessUtilityFunction · 0.85
get_rule_exprFunction · 0.85
CreateTriggerFiringOnFunction · 0.85
DefineDomainFunction · 0.85
AlterDomainDefaultFunction · 0.85
domainAddConstraintFunction · 0.85
AtExecGPSplitPartitionFunction · 0.85
interpret_AS_clauseFunction · 0.85

Calls 1

palloc0Function · 0.50

Tested by 2