76 elog(
ERROR,
"can't negate an empty subexpression");
102 newopexpr->
opno = negator;
104 newopexpr->opresulttype = opexpr->opresulttype;
105 newopexpr->opretset = opexpr->opretset;
106 newopexpr->opcollid = opexpr->opcollid;
107 newopexpr->inputcollid = opexpr->inputcollid;
110 return (
Node *) newopexpr;
114 case T_ScalarArrayOpExpr:
127 newopexpr->
opno = negator;
132 newopexpr->inputcollid = saopexpr->inputcollid;
135 return (
Node *) newopexpr;
165 foreach(lc, expr->
args)
178 foreach(lc, expr->
args)
216 newexpr->argisrow = expr->argisrow;
218 return (
Node *) newexpr;
249 elog(
ERROR,
"unrecognized booltesttype: %d",
254 return (
Node *) newexpr;
328 foreach(
arg, andlist)
336 out_list =
lappend(out_list, subexpr);
362 out_list =
lappend(out_list, subexpr);
428 if (!carg->constisnull && !
DatumGetBool(carg->constvalue))
436 if (carg->constisnull || !
DatumGetBool(carg->constvalue))
472 if (carg->constisnull ||
DatumGetBool(carg->constvalue))
480 if (!carg->constisnull &&
DatumGetBool(carg->constvalue))
520 int num_subclauses = 0;
539 foreach(temp, orlist)
548 if (reference ==
NIL || nclauses < num_subclauses)
550 reference = subclauses;
551 num_subclauses = nclauses;
571 foreach(temp, reference)
577 foreach(temp2, orlist)
591 if (!
equal(refclause, clause))
600 winners =
lappend(winners, refclause);
620 foreach(temp, orlist)
629 if (subclauses !=
NIL)
645 neworlist =
lappend(neworlist, clause);
660 if (neworlist !=
NIL)
#define Assert(condition)
bool equal(const void *a, const void *b)
List * list_union(const List *list1, const List *list2)
List * lappend(List *list, void *datum)
List * list_concat(List *list1, const List *list2)
bool list_member(const List *list, const void *datum)
List * list_difference(const List *list1, const List *list2)
Oid get_negator(Oid opno)
Expr * make_notclause(Expr *notclause)
Expr * make_andclause(List *andclauses)
Node * makeBoolConst(bool value, bool isnull)
Expr * make_orclause(List *orclauses)
static bool is_andclause(const void *clause)
static bool is_orclause(const void *clause)
#define IsA(nodeptr, _type_)
static int list_length(const List *l)
static bool DatumGetBool(Datum X)
static Expr * process_duplicate_ors(List *orlist)
static List * pull_ors(List *orlist)
Node * negate_clause(Node *node)
static List * pull_ands(List *andlist)
static Expr * find_duplicate_ors(Expr *qual, bool is_check)
Expr * canonicalize_qual(Expr *qual, bool is_check)
BoolTestType booltesttype
NullTestType nulltesttype