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

Function ExecInitExprWithParams

src/backend/executor/execExpr.c:171–200  ·  view source on GitHub ↗

* ExecInitExprWithParams: prepare a standalone expression tree for execution * * This is the same as ExecInitExpr, except that there is no parent PlanState, * and instead we may have a ParamListInfo describing PARAM_EXTERN Params. */

Source from the content-addressed store, hash-verified

169 * and instead we may have a ParamListInfo describing PARAM_EXTERN Params.
170 */
171ExprState *
172ExecInitExprWithParams(Expr *node, ParamListInfo ext_params)
173{
174 ExprState *state;
175 ExprEvalStep scratch = {0};
176
177 /* Special case: NULL expression produces a NULL ExprState pointer */
178 if (node == NULL)
179 return NULL;
180
181 /* Initialize ExprState with empty step list */
182 state = makeNode(ExprState);
183 state->expr = node;
184 state->parent = NULL;
185 state->ext_params = ext_params;
186
187 /* Insert EEOP_*_FETCHSOME steps as needed */
188 ExecInitExprSlots(state, (Node *) node);
189
190 /* Compile the expression proper */
191 ExecInitExprRec(node, state, &state->resvalue, &state->resnull);
192
193 /* Finally, append a DONE step */
194 scratch.opcode = EEOP_DONE;
195 ExprEvalPushStep(state, &scratch);
196
197 ExecReadyExpr(state);
198
199 return state;
200}
201
202/*
203 * ExecInitQual: prepare a qual for execution by ExecQual

Callers 2

exec_eval_simple_exprFunction · 0.85
initPartEveryIteratorFunction · 0.85

Calls 4

ExecInitExprSlotsFunction · 0.85
ExecInitExprRecFunction · 0.85
ExprEvalPushStepFunction · 0.85
ExecReadyExprFunction · 0.85

Tested by

no test coverage detected