diff options
author | Robert Haas <rhaas@postgresql.org> | 2016-03-29 15:21:57 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2016-03-29 15:21:57 -0400 |
commit | 96f8373cad5d6066baeb7a1c5a88f6f5c9661974 (patch) | |
tree | ac44f97029e26ad4c2f5e0846e06f32f139d07ab /src/backend/executor/nodeAgg.c | |
parent | 5fe5a2cee91117673e04617aeb1a38e305dcd783 (diff) | |
download | postgresql-96f8373cad5d6066baeb7a1c5a88f6f5c9661974.tar.gz postgresql-96f8373cad5d6066baeb7a1c5a88f6f5c9661974.zip |
Fix bug in aggregate (de)serialization commit.
resulttypeLen and resulttypeByVal must be set correctly when serializing
aggregates, not just when finalizing them. This was in David's final
patch but I downloaded the wrong version by mistake and failed to spot
the error.
David Rowley
Diffstat (limited to 'src/backend/executor/nodeAgg.c')
-rw-r--r-- | src/backend/executor/nodeAgg.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c index aba54195a30..614b26b8e3c 100644 --- a/src/backend/executor/nodeAgg.c +++ b/src/backend/executor/nodeAgg.c @@ -2862,11 +2862,10 @@ ExecInitAgg(Agg *node, EState *estate, int eflags) fmgr_info_set_expr((Node *) finalfnexpr, &peragg->finalfn); } - /* when finalizing we get info about the final result's datatype */ - if (aggstate->finalizeAggs) - get_typlenbyval(aggref->aggtype, - &peragg->resulttypeLen, - &peragg->resulttypeByVal); + /* get info about the output value's datatype */ + get_typlenbyval(aggref->aggoutputtype, + &peragg->resulttypeLen, + &peragg->resulttypeByVal); /* * initval is potentially null, so don't try to access it as a struct |