mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-08-26 06:17:18 +02:00
Prevent generating EEOP_AGG_STRICT_INPUT_CHECK operations when nargs == 0.
This only became a problem with4c640f4f38
, 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-, like4c640f4f38
.
This commit is contained in:
parent
fd59b29c87
commit
6eb31cedb3
@ -3023,7 +3023,7 @@ ExecBuildAggTrans(AggState *aggstate, AggStatePerPhase phase,
|
|||||||
* just keep the prior transValue. This is true for both plain and
|
* just keep the prior transValue. This is true for both plain and
|
||||||
* sorted/distinct aggregates.
|
* 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.opcode = EEOP_AGG_STRICT_INPUT_CHECK;
|
||||||
scratch.d.agg_strict_input_check.nulls = strictnulls;
|
scratch.d.agg_strict_input_check.nulls = strictnulls;
|
||||||
|
@ -2124,6 +2124,8 @@ llvm_compile_expr(ExprState *state)
|
|||||||
LLVMValueRef v_nullp;
|
LLVMValueRef v_nullp;
|
||||||
LLVMBasicBlockRef *b_checknulls;
|
LLVMBasicBlockRef *b_checknulls;
|
||||||
|
|
||||||
|
Assert(nargs > 0);
|
||||||
|
|
||||||
jumpnull = op->d.agg_strict_input_check.jumpnull;
|
jumpnull = op->d.agg_strict_input_check.jumpnull;
|
||||||
v_nullp = l_ptr_const(nulls, l_ptr(TypeStorageBool));
|
v_nullp = l_ptr_const(nulls, l_ptr(TypeStorageBool));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user