diff options
Diffstat (limited to 'src/backend/optimizer/prep/prepqual.c')
-rw-r--r-- | src/backend/optimizer/prep/prepqual.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/backend/optimizer/prep/prepqual.c b/src/backend/optimizer/prep/prepqual.c index 234dc5b3e7f..2bd6c200cfa 100644 --- a/src/backend/optimizer/prep/prepqual.c +++ b/src/backend/optimizer/prep/prepqual.c @@ -32,6 +32,7 @@ #include "postgres.h" #include "nodes/makefuncs.h" +#include "nodes/nodeFuncs.h" #include "optimizer/clauses.h" #include "optimizer/prep.h" #include "utils/lsyscache.h" @@ -333,7 +334,7 @@ pull_ands(List *andlist) * built a new arglist not shared with any other expr. Otherwise we'd * need a list_copy here. */ - if (and_clause(subexpr)) + if (is_andclause(subexpr)) out_list = list_concat(out_list, pull_ands(((BoolExpr *) subexpr)->args)); else @@ -365,7 +366,7 @@ pull_ors(List *orlist) * built a new arglist not shared with any other expr. Otherwise we'd * need a list_copy here. */ - if (or_clause(subexpr)) + if (is_orclause(subexpr)) out_list = list_concat(out_list, pull_ors(((BoolExpr *) subexpr)->args)); else @@ -415,7 +416,7 @@ pull_ors(List *orlist) static Expr * find_duplicate_ors(Expr *qual, bool is_check) { - if (or_clause((Node *) qual)) + if (is_orclause(qual)) { List *orlist = NIL; ListCell *temp; @@ -459,7 +460,7 @@ find_duplicate_ors(Expr *qual, bool is_check) /* Now we can look for duplicate ORs */ return process_duplicate_ors(orlist); } - else if (and_clause((Node *) qual)) + else if (is_andclause(qual)) { List *andlist = NIL; ListCell *temp; @@ -550,7 +551,7 @@ process_duplicate_ors(List *orlist) { Expr *clause = (Expr *) lfirst(temp); - if (and_clause((Node *) clause)) + if (is_andclause(clause)) { List *subclauses = ((BoolExpr *) clause)->args; int nclauses = list_length(subclauses); @@ -588,7 +589,7 @@ process_duplicate_ors(List *orlist) { Expr *clause = (Expr *) lfirst(temp2); - if (and_clause((Node *) clause)) + if (is_andclause(clause)) { if (!list_member(((BoolExpr *) clause)->args, refclause)) { @@ -631,7 +632,7 @@ process_duplicate_ors(List *orlist) { Expr *clause = (Expr *) lfirst(temp); - if (and_clause((Node *) clause)) + if (is_andclause(clause)) { List *subclauses = ((BoolExpr *) clause)->args; |