diff options
author | Marc G. Fournier <scrappy@hub.org> | 1996-10-24 06:33:31 +0000 |
---|---|---|
committer | Marc G. Fournier <scrappy@hub.org> | 1996-10-24 06:33:31 +0000 |
commit | 82a4b0f225af03d99318e63951e1ea3ba08f74b7 (patch) | |
tree | a71cb5c35c3d687df19fded1415047827e5f7676 | |
parent | b5c7fe5518f191ed702e3f188c06e597cf20bb09 (diff) | |
download | postgresql-82a4b0f225af03d99318e63951e1ea3ba08f74b7.tar.gz |
Fixes:
It's bug in nodeAgg.c on lines 241, 242:
null_array = malloc(nagg);
for (i=0;i<nagg;i++)
null_array[i] = 'n';
oneTuple = heap_formtuple(tupType, tupValue, null_array);
- your query has not only aggregates but also 'group by-ed' fields and so
null_array should contain tupType->natts elements (tupType->natts > nagg in
your case).
Patch follows and it's very simple.
VAdim
-rw-r--r-- | src/backend/executor/nodeAgg.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c index ee187367c7..94764bfa3a 100644 --- a/src/backend/executor/nodeAgg.c +++ b/src/backend/executor/nodeAgg.c @@ -238,8 +238,8 @@ ExecAgg(Agg *node) tupValue = projInfo->pi_tupValue; /* initially, set all the values to NULL */ - null_array = malloc(nagg); - for (i=0;i<nagg;i++) + null_array = malloc(tupType->natts); + for (i=0;i<tupType->natts;i++) null_array[i] = 'n'; oneTuple = heap_formtuple(tupType, tupValue, null_array); free(null_array); |