diff options
author | Andres Freund <andres@anarazel.de> | 2018-11-03 15:55:23 -0700 |
---|---|---|
committer | Andres Freund <andres@anarazel.de> | 2018-11-03 15:55:23 -0700 |
commit | 793beab37e8f7ec6a4ef39395c6c866d7e4c7af5 (patch) | |
tree | 229f8bcbf2f5745efb4321bcdb1266612c0078bb /src/backend/executor | |
parent | 4c640f4f38d5d68cbe33ddfabbdc56eea8f1e173 (diff) | |
download | postgresql-793beab37e8f7ec6a4ef39395c6c866d7e4c7af5.tar.gz postgresql-793beab37e8f7ec6a4ef39395c6c866d7e4c7af5.zip |
Prevent generating EEOP_AGG_STRICT_INPUT_CHECK operations when nargs == 0.
This only became a problem with 4c640f4f38, which didn't synchronize
the value agg_strict_input_check.nargs is set to, with the guard
condition for emitting the operation.
Besides such instructions being unnecessary overhead, currently the
LLVM JIT provider doesn't support them. It seems more sensible to
avoid generating such instruction than supporting them. Add assertions
to make it easier to debug a potential further occurance.
Discussion: https://postgr.es/m/2a505161-2727-2473-7c46-591ed108ac52@email.cz
Backpatch: 11-, like 4c640f4f38.
Diffstat (limited to 'src/backend/executor')
-rw-r--r-- | src/backend/executor/execExpr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/executor/execExpr.c b/src/backend/executor/execExpr.c index 5397de4e050..4b44a4a4ead 100644 --- a/src/backend/executor/execExpr.c +++ b/src/backend/executor/execExpr.c @@ -3023,7 +3023,7 @@ ExecBuildAggTrans(AggState *aggstate, AggStatePerPhase phase, * just keep the prior transValue. This is true for both plain and * sorted/distinct aggregates. */ - if (trans_fcinfo->flinfo->fn_strict && numInputs > 0) + if (trans_fcinfo->flinfo->fn_strict && pertrans->numTransInputs > 0) { scratch.opcode = EEOP_AGG_STRICT_INPUT_CHECK; scratch.d.agg_strict_input_check.nulls = strictnulls; |