hi.
since InitJsonItemCoercions cannot return NULL.
per transformJsonFuncExpr, jsexpr->item_coercions not null imply
jsexpr->result_coercion not null.
so I did the attached refactoring.
now every ExecInitJsonExprCoercion function call followed with:
scratch->opcode = EEOP_JUMP;
scratch->d.jump.jumpdone = -1; /* set below */
jumps_to_coerce_finish = lappend_int(jumps_to_coerce_finish,
state->steps_len);
ExprEvalPushStep(state, scratch);
It looks more consistent.
we can also change
+ */
+ if (jexpr->result_coercion || jexpr->item_coercions)
+ {
+
to
+ if (jexpr->result_coercion)
since jexpr->item_coercions not null imply jexpr->result_coercion not null.