* 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
| 307 | * can just apply ExecInitExpr to produce suitable input for ExecCheck. |
| 308 | */ |
| 309 | ExprState * |
| 310 | ExecInitCheck(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. |
no test coverage detected