Skip to content

Commit f7f2a28

Browse files
committed
Don't add bailout adjustment for non-strict deserialize calls.
When building aggregate expression steps, strict checks need a bailout jump for when a null value is encountered, so there is a list of steps that require later adjustment. Adding entries to that list for steps that aren't actually strict would be harmless, except that there is an Assert which catches them. This leads to spurious errors on asserts builds, for data sets that trigger parallel aggregation of an aggregate with a non-strict deserialization function (no such aggregates exist in the core system). Repair by not adding the adjustment entry when it's not needed. Backpatch back to 11 where the code was introduced. Per a report from Darafei (Komzpa) of the PostGIS project; analysis and patch by me. Discussion: https://postgr.es/m/87mty7peb3.fsf@news-spur.riddles.org.uk
1 parent fdd405c commit f7f2a28

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/backend/executor/execExpr.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2950,8 +2950,10 @@ ExecBuildAggTrans(AggState *aggstate, AggStatePerPhase phase,
29502950
scratch.resnull = &trans_fcinfo->argnull[argno + 1];
29512951

29522952
ExprEvalPushStep(state, &scratch);
2953-
adjust_bailout = lappend_int(adjust_bailout,
2954-
state->steps_len - 1);
2953+
/* don't add an adjustment unless the function is strict */
2954+
if (pertrans->deserialfn.fn_strict)
2955+
adjust_bailout = lappend_int(adjust_bailout,
2956+
state->steps_len - 1);
29552957

29562958
/* restore normal settings of scratch fields */
29572959
scratch.resvalue = &state->resvalue;

0 commit comments

Comments
 (0)