Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 96f8373

Browse files
committed
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
1 parent 5fe5a2c commit 96f8373

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/backend/executor/nodeAgg.c

+4-5
Original file line numberDiff line numberDiff line change
@@ -2862,11 +2862,10 @@ ExecInitAgg(Agg *node, EState *estate, int eflags)
28622862
fmgr_info_set_expr((Node *) finalfnexpr, &peragg->finalfn);
28632863
}
28642864

2865-
/* when finalizing we get info about the final result's datatype */
2866-
if (aggstate->finalizeAggs)
2867-
get_typlenbyval(aggref->aggtype,
2868-
&peragg->resulttypeLen,
2869-
&peragg->resulttypeByVal);
2865+
/* get info about the output value's datatype */
2866+
get_typlenbyval(aggref->aggoutputtype,
2867+
&peragg->resulttypeLen,
2868+
&peragg->resulttypeByVal);
28702869

28712870
/*
28722871
* initval is potentially null, so don't try to access it as a struct

0 commit comments

Comments
 (0)