Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbe09bc9

Browse files
committed
Modify nodeAgg.c so that no rows are returned for a GROUP BY
with no input rows, per pghackers discussions around 7/22/99. Clean upa bunch of ugly coding while at it; remove redundant re-lookup ofaggregate info at start of each new GROUP. Arrange to pfree intermediatevalues when they are pass-by-ref types, so that aggregates on pass-by-reftypes no longer eat memory. This takes care of a couple of TODO items...
1 parent40f6524 commitbe09bc9

File tree

4 files changed

+452
-416
lines changed

4 files changed

+452
-416
lines changed

‎src/backend/executor/execQual.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.61 1999/09/2602:28:15 tgl Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.62 1999/09/2621:21:09 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -209,8 +209,8 @@ ExecEvalArrayRef(ArrayRef *arrayRef,
209209
staticDatum
210210
ExecEvalAggref(Aggref*aggref,ExprContext*econtext,bool*isNull)
211211
{
212-
*isNull=econtext->ecxt_nulls[aggref->aggno];
213-
returnecontext->ecxt_values[aggref->aggno];
212+
*isNull=econtext->ecxt_aggnulls[aggref->aggno];
213+
returnecontext->ecxt_aggvalues[aggref->aggno];
214214
}
215215

216216
/* ----------------------------------------------------------------
@@ -244,7 +244,6 @@ ExecEvalVar(Var *variable, ExprContext *econtext, bool *isNull)
244244
AttrNumberattnum;
245245
HeapTupleheapTuple;
246246
TupleDesctuple_type;
247-
Bufferbuffer;
248247
boolbyval;
249248
int16len;
250249

@@ -272,22 +271,21 @@ ExecEvalVar(Var *variable, ExprContext *econtext, bool *isNull)
272271
*/
273272
heapTuple=slot->val;
274273
tuple_type=slot->ttc_tupleDescriptor;
275-
buffer=slot->ttc_buffer;
276274

277275
attnum=variable->varattno;
278276

279277
/* (See prolog for explanation of this Assert) */
280278
Assert(attnum <=0||
281279
(attnum-1 <=tuple_type->natts-1&&
282280
tuple_type->attrs[attnum-1]!=NULL&&
283-
variable->vartype==tuple_type->attrs[attnum-1]->atttypid))
281+
variable->vartype==tuple_type->attrs[attnum-1]->atttypid));
284282

285283
/*
286284
* If the attribute number is invalid, then we are supposed to return
287285
* the entire tuple, we give back a whole slot so that callers know
288286
* what the tuple looks like.
289287
*/
290-
if (attnum==InvalidAttrNumber)
288+
if (attnum==InvalidAttrNumber)
291289
{
292290
TupleTableSlot*tempSlot;
293291
TupleDesctd;
@@ -301,7 +299,7 @@ ExecEvalVar(Var *variable, ExprContext *econtext, bool *isNull)
301299
tempSlot->ttc_whichplan=-1;
302300

303301
tup=heap_copytuple(heapTuple);
304-
td=CreateTupleDescCopy(slot->ttc_tupleDescriptor);
302+
td=CreateTupleDescCopy(tuple_type);
305303

306304
ExecSetSlotDescriptor(tempSlot,td);
307305

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp