Skip to content

Commit 6f9a62b

Browse files
committed
SQL/JSON: Remove useless code in ExecInitJsonExpr()
The code was for adding an unconditional JUMP to the next step, which is unnecessary processing. Reported-by: Jian He <jian.universality@gmail.com> Discussion: https://postgr.es/m/CACJufxEo4sUjKCYtda0_qt9tazqqKPmF1cqhW9KBOUeJFqQd2g@mail.gmail.com Backpatch-through: 17
1 parent 4fc6a55 commit 6f9a62b

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

src/backend/executor/execExpr.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4312,21 +4312,6 @@ ExecInitJsonExpr(JsonExpr *jsexpr, ExprState *state,
43124312
scratch->d.constval.isnull = true;
43134313
ExprEvalPushStep(state, scratch);
43144314

4315-
/*
4316-
* Jump to coerce the NULL using json_populate_type() if needed. Coercing
4317-
* NULL is only interesting when the RETURNING type is a domain whose
4318-
* constraints must be checked. jsexpr->use_json_coercion must have been
4319-
* set in that case.
4320-
*/
4321-
if (get_typtype(jsexpr->returning->typid) == TYPTYPE_DOMAIN &&
4322-
DomainHasConstraints(jsexpr->returning->typid))
4323-
{
4324-
Assert(jsexpr->use_json_coercion);
4325-
scratch->opcode = EEOP_JUMP;
4326-
scratch->d.jump.jumpdone = state->steps_len + 1;
4327-
ExprEvalPushStep(state, scratch);
4328-
}
4329-
43304315
/*
43314316
* To handle coercion errors softly, use the following ErrorSaveContext to
43324317
* pass to ExecInitExprRec() when initializing the coercion expressions

0 commit comments

Comments
 (0)