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

Function ExecCheck

src/backend/executor/execExpr.c:864–883  ·  view source on GitHub ↗

* ExecCheck - evaluate a check constraint * * For check constraints, a null result is taken as TRUE, ie the constraint * passes. * * The check constraint may have been prepared with ExecInitCheck * (possibly via ExecPrepareCheck) if the caller had it in implicit-AND * format, but a regular boolean expression prepared with ExecInitExpr or * ExecPrepareExpr works too. */

Source from the content-addressed store, hash-verified

862 * ExecPrepareExpr works too.
863 */
864bool
865ExecCheck(ExprState *state, ExprContext *econtext)
866{
867 Datum ret;
868 bool isnull;
869
870 /* short-circuit (here and in ExecInitCheck) for empty restriction list */
871 if (state == NULL)
872 return true;
873
874 /* verify that expression was not compiled using ExecInitQual */
875 Assert(!(state->flags & EEO_FLAG_IS_QUAL));
876
877 ret = ExecEvalExprSwitchContext(state, econtext, &isnull);
878
879 if (isnull)
880 return true;
881
882 return DatumGetBool(ret);
883}
884
885/*
886 * Prepare a compiled expression for execution. This has to be called for

Callers 9

domain_check_inputFunction · 0.85
ATRewriteTableFunction · 0.85
ExecRelCheckFunction · 0.85
ExecPartitionCheckFunction · 0.85
ExecNestLoop_gutsFunction · 0.85
ExternalConstraintCheckFunction · 0.85
ExternalPartitionCheckFunction · 0.85

Calls 2

DatumGetBoolFunction · 0.85

Tested by

no test coverage detected