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

Function check_constant_qual

src/backend/executor/nodeMergejoin.c:557–572  ·  view source on GitHub ↗

* Check that a qual condition is constant true or constant false. * If it is constant false (or null), set *is_const_false to true. * * Constant true would normally be represented by a NIL list, but we allow an * actual bool Const as well. We do expect that the planner will have thrown * away any non-constant terms that have been ANDed with a constant false. */

Source from the content-addressed store, hash-verified

555 * away any non-constant terms that have been ANDed with a constant false.
556 */
557static bool
558check_constant_qual(List *qual, bool *is_const_false)
559{
560 ListCell *lc;
561
562 foreach(lc, qual)
563 {
564 Const *con = (Const *) lfirst(lc);
565
566 if (!con || !IsA(con, Const))
567 return false;
568 if (con->constisnull || !DatumGetBool(con->constvalue))
569 *is_const_false = true;
570 }
571 return true;
572}
573
574
575/* ----------------------------------------------------------------

Callers 1

ExecInitMergeJoinFunction · 0.85

Calls 2

DatumGetBoolFunction · 0.85
foreachFunction · 0.50

Tested by

no test coverage detected