diff options
Diffstat (limited to 'src/backend/executor')
-rw-r--r-- | src/backend/executor/execQual.c | 10 | ||||
-rw-r--r-- | src/backend/executor/nodeAgg.c | 16 |
2 files changed, 23 insertions, 3 deletions
diff --git a/src/backend/executor/execQual.c b/src/backend/executor/execQual.c index 55a12bd8317..f1ff8bbbb4c 100644 --- a/src/backend/executor/execQual.c +++ b/src/backend/executor/execQual.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.26 1998/02/26 04:31:13 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.27 1998/03/30 16:35:50 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -203,8 +203,7 @@ ExecEvalArrayRef(ArrayRef *arrayRef, static Datum ExecEvalAggreg(Aggreg *agg, ExprContext *econtext, bool *isNull) { - - *isNull = econtext->ecxt_nulls[agg->aggno]; + *isNull = econtext->ecxt_nulls[agg->aggno]; return econtext->ecxt_values[agg->aggno]; } @@ -648,6 +647,8 @@ ExecEvalFuncArgs(FunctionCachePtr fcache, econtext, &argIsNull, argIsDone); + + if (!(*argIsDone)) { Assert(i == 0); @@ -1356,8 +1357,11 @@ ExecQual(List *qual, ExprContext *econtext) * ---------------- */ result = false; + foreach(clause, qual) { + + result = ExecQualClause((Node *) lfirst(clause), econtext); if (result == true) break; diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c index 848bd616bf0..c2b77c6e050 100644 --- a/src/backend/executor/nodeAgg.c +++ b/src/backend/executor/nodeAgg.c @@ -29,6 +29,7 @@ #include "storage/bufmgr.h" #include "utils/palloc.h" #include "utils/syscache.h" +#include "optimizer/clauses.h" /* * AggFuncInfo - @@ -109,10 +110,16 @@ ExecAgg(Agg *node) isNull1 = FALSE, isNull2 = FALSE; + + /***S*H***/ + do { + + /* --------------------- * get state info from node * --------------------- */ + aggstate = node->aggstate; if (aggstate->agg_done) return NULL; @@ -229,6 +236,7 @@ ExecAgg(Agg *node) } } } + /* ---------------- * for each tuple from the the outer plan, apply all the aggregates @@ -477,11 +485,19 @@ ExecAgg(Agg *node) * slot and return it. * ---------------- */ + + /***S*H***/ + } + while((ExecQual(fix_opids(node->plan.qual),econtext)!=true) && + (node->plan.qual!=NULL)); + + ExecStoreTuple(oneTuple, aggstate->csstate.css_ScanTupleSlot, InvalidBuffer, false); econtext->ecxt_scantuple = aggstate->csstate.css_ScanTupleSlot; + resultSlot = ExecProject(projInfo, &isDone); if (oneTuple) |