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

Function ExecInitCheck

src/backend/executor/execExpr.c:309–324  ·  view source on GitHub ↗

* ExecInitCheck: prepare a check constraint for execution by ExecCheck * * This is much like ExecInitQual/ExecQual, except that a null result from * the conjunction is treated as TRUE. This behavior is appropriate for * evaluating CHECK constraints, since SQL specifies that NULL constraint * conditions are not failures. * * Note that like ExecInitQual, this expects input in implicit-AND fo

Source from the content-addressed store, hash-verified

307 * can just apply ExecInitExpr to produce suitable input for ExecCheck.
308 */
309ExprState *
310ExecInitCheck(List *qual, PlanState *parent)
311{
312 /* short-circuit (here and in ExecCheck) for empty restriction list */
313 if (qual == NIL)
314 return NULL;
315
316 Assert(IsA(qual, List));
317
318 /*
319 * Just convert the implicit-AND list to an explicit AND (if there's more
320 * than one entry), and compile normally. Unlike ExecQual, we can't
321 * short-circuit on NULL results, so the regular AND behavior is needed.
322 */
323 return ExecInitExpr(make_ands_explicit(qual), parent);
324}
325
326/*
327 * Call ExecInitExpr() on a list of expressions, return a list of ExprStates.

Callers 2

ExecPrepareCheckFunction · 0.85
ExecInitNestLoopFunction · 0.85

Calls 2

ExecInitExprFunction · 0.85
make_ands_explicitFunction · 0.85

Tested by

no test coverage detected