1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-08 11:42:09 +03:00

Fix STRICT check for strict aggregates with NULL ORDER BY columns.

I (Andres) broke this unintentionally in 69c3936a14, by checking
strictness for all input expressions computed for an aggregate, rather
than just the input for the aggregate transition function.

Reported-By: Ondřej Bouda
Bisected-By: Tom Lane
Diagnosed-By: Andrew Gierth
Discussion: https://postgr.es/m/2a505161-2727-2473-7c46-591ed108ac52@email.cz
Backpatch: 11-, like 69c3936a14
This commit is contained in:
Andres Freund
2018-11-03 14:35:23 -07:00
parent 981dc2baa8
commit 4c640f4f38
3 changed files with 23 additions and 1 deletions

View File

@ -3028,7 +3028,7 @@ ExecBuildAggTrans(AggState *aggstate, AggStatePerPhase phase,
scratch.opcode = EEOP_AGG_STRICT_INPUT_CHECK;
scratch.d.agg_strict_input_check.nulls = strictnulls;
scratch.d.agg_strict_input_check.jumpnull = -1; /* adjust later */
scratch.d.agg_strict_input_check.nargs = numInputs;
scratch.d.agg_strict_input_check.nargs = pertrans->numTransInputs;
ExprEvalPushStep(state, &scratch);
adjust_bailout = lappend_int(adjust_bailout,
state->steps_len - 1);