mirror of
https://github.com/postgres/postgres.git
synced 2025-05-17 06:41:24 +03:00
Remove unreachable code in expression evaluation.
The previous code still contained expression evaluation time support for CaseExprs without a defresult. But transformCaseExpr() creates a default expression if necessary. Author: Andres Freund Discussion: https://postgr.es/m/4834.1490480275@sss.pgh.pa.us
This commit is contained in:
parent
8acf08c68d
commit
ad46a2aa79
@ -1385,20 +1385,12 @@ ExecInitExprRec(Expr *node, PlanState *parent, ExprState *state,
|
|||||||
state->steps[whenstep].d.jump.jumpdone = state->steps_len;
|
state->steps[whenstep].d.jump.jumpdone = state->steps_len;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (caseExpr->defresult)
|
/* transformCaseExpr always adds a default */
|
||||||
{
|
Assert(caseExpr->defresult);
|
||||||
/* evaluate ELSE expr into CASE's result variables */
|
|
||||||
ExecInitExprRec(caseExpr->defresult, parent, state,
|
/* evaluate ELSE expr into CASE's result variables */
|
||||||
resv, resnull);
|
ExecInitExprRec(caseExpr->defresult, parent, state,
|
||||||
}
|
resv, resnull);
|
||||||
else
|
|
||||||
{
|
|
||||||
/* default ELSE is to return NULL */
|
|
||||||
scratch.opcode = EEOP_CONST;
|
|
||||||
scratch.d.constval.value = (Datum) 0;
|
|
||||||
scratch.d.constval.isnull = true;
|
|
||||||
ExprEvalPushStep(state, &scratch);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* adjust jump targets */
|
/* adjust jump targets */
|
||||||
foreach(lc, adjust_jumps)
|
foreach(lc, adjust_jumps)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user