* 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. */
| 555 | * away any non-constant terms that have been ANDed with a constant false. |
| 556 | */ |
| 557 | static bool |
| 558 | check_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 | /* ---------------------------------------------------------------- |
no test coverage detected