*/
/*
- * We loop retrieving groups until we find one matching
- * node->plan.qual
+ * We loop retrieving groups until we find one matching node->plan.qual
*/
do
{
MemSet(aggFuncInfo, 0, sizeof(AggFuncInfo) * nagg);
noInitValue = (int *) palloc(sizeof(int) * nagg);
- MemSet(noInitValue, 0, sizeof(noInitValue) * nagg);
+ MemSet(noInitValue, 0, sizeof(int) * nagg);
outerPlan = outerPlan(node);
oneTuple = NULL;
projInfo = aggstate->csstate.cstate.cs_ProjInfo;
- aggno = 0;
+ aggno = -1;
foreach(alist, node->aggs)
{
Aggref *aggref = lfirst(alist);
xfn2_oid,
finalfn_oid;
+ aggno++;
+
/* ---------------------
* find transfer functions of all the aggregates and initialize
* their initial values
nulls[aggno] = 1;
}
}
- aggno++;
}
/* ----------------
tupValue = projInfo->pi_tupValue;
/* initially, set all the values to NULL */
- null_array = palloc(tupType->natts);
+ null_array = palloc(sizeof(char) * tupType->natts);
for (aggno = 0; aggno < tupType->natts; aggno++)
null_array[aggno] = 'n';
oneTuple = heap_formtuple(tupType, tupValue, null_array);
break;
}
- aggno = 0;
+ aggno = -1;
foreach(alist, node->aggs)
{
Aggref *aggref = lfirst(alist);
AttrNumber attnum;
int2 attlen = 0;
Datum newVal = (Datum) NULL;
- AggFuncInfo *aggfns = &aggFuncInfo[aggno];
+ AggFuncInfo *aggfns = &aggFuncInfo[++aggno];
Datum args[2];
Node *tagnode = NULL;
(FmgrValues *) &xfn2_val, &isNull2);
Assert(!isNull2);
}
- aggno++;
}
/*
* --------------
*/
- aggno = 0;
+ aggno = -1;
foreach(alist, node->aggs)
{
char *args[2];
- AggFuncInfo *aggfns = &aggFuncInfo[aggno];
+ AggFuncInfo *aggfns = &aggFuncInfo[++aggno];
if (noInitValue[aggno])
{
value1[aggno] = value2[aggno];
else
elog(ERROR, "ExecAgg: no valid transition functions??");
- aggno++;
}
/*
econtext = aggstate->csstate.cstate.cs_ExprContext;
econtext->ecxt_values =
- (Datum *) palloc(sizeof(Datum) * length(node->aggs));
+ (Datum *) palloc(sizeof(Datum) * length(node->aggs));
MemSet(econtext->ecxt_values, 0, sizeof(Datum) * length(node->aggs));
- econtext->ecxt_nulls = (char *) palloc(length(node->aggs));
- MemSet(econtext->ecxt_nulls, 0, length(node->aggs));
+ econtext->ecxt_nulls = (char *) palloc(sizeof(char) * length(node->aggs));
+ MemSet(econtext->ecxt_nulls, 0, sizeof(char) * length(node->aggs));
/*
* initializes child nodes
ExecCountSlotsAgg(Agg *node)
{
return ExecCountSlotsNode(outerPlan(node)) +
- ExecCountSlotsNode(innerPlan(node)) +
- AGG_NSLOTS;
+ ExecCountSlotsNode(innerPlan(node)) +
+ AGG_NSLOTS;
}
/* ------------------------
tempSlot = makeNode(TupleTableSlot);
tempSlot->ttc_shouldFree = false;
tempSlot->ttc_descIsNew = true;
- tempSlot->ttc_tupleDescriptor = (TupleDesc) NULL,
- tempSlot->ttc_buffer = InvalidBuffer;
+ tempSlot->ttc_tupleDescriptor = (TupleDesc) NULL;
+ tempSlot->ttc_buffer = InvalidBuffer;
tempSlot->ttc_whichplan = -1;
tup = heap_copytuple(heapTuple);
aggstate->agg_done = FALSE;
MemSet(econtext->ecxt_values, 0, sizeof(Datum) * length(node->aggs));
- MemSet(econtext->ecxt_nulls, 0, length(node->aggs));
+ MemSet(econtext->ecxt_nulls, 0, sizeof(char) * length(node->aggs));
/*
* if chgParam of subnode is not null then plan will be re-scanned by
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/Attic/gram.c,v 2.63 1999/01/25 12:01:07 vadim Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/Attic/gram.c,v 2.64 1999/01/26 23:32:04 momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
-1, -1, -1, -1, -1, -1, -1, 214
};
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
-#line 3 "/usr/share/misc/bison.simple"
+#line 3 "/usr/local/bison/bison.simple"
/* Skeleton output parser for bison,
Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
#endif
#endif
\f
-#line 196 "/usr/share/misc/bison.simple"
+#line 196 "/usr/local/bison/bison.simple"
/* The user can define YYPARSE_PARAM as the name of an argument to be passed
into yyparse. The argument should have type void *.
break;}
}
/* the action file gets copied in in place of this dollarsign */
-#line 498 "/usr/share/misc/bison.simple"
+#line 498 "/usr/local/bison/bison.simple"
\f
yyvsp -= yylen;
yyssp -= yylen;