Commit 96f8373c authored by Robert Haas's avatar Robert Haas

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
parent 5fe5a2ce
...@@ -2862,11 +2862,10 @@ ExecInitAgg(Agg *node, EState *estate, int eflags) ...@@ -2862,11 +2862,10 @@ ExecInitAgg(Agg *node, EState *estate, int eflags)
fmgr_info_set_expr((Node *) finalfnexpr, &peragg->finalfn); fmgr_info_set_expr((Node *) finalfnexpr, &peragg->finalfn);
} }
/* when finalizing we get info about the final result's datatype */ /* get info about the output value's datatype */
if (aggstate->finalizeAggs) get_typlenbyval(aggref->aggoutputtype,
get_typlenbyval(aggref->aggtype, &peragg->resulttypeLen,
&peragg->resulttypeLen, &peragg->resulttypeByVal);
&peragg->resulttypeByVal);
/* /*
* initval is potentially null, so don't try to access it as a struct * initval is potentially null, so don't try to access it as a struct
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment