Skip to content

Commit 16a5677

Browse files
committed
Fix variable lifespan in ExecInitCoerceToDomain().
This undoes a mistake in 1ec7679: domainval and domainnull were meant to live across loop iterations, but they were incorrectly moved inside the loop. The effect was only to emit useless extra EEOP_MAKE_READONLY steps, so it's not a big deal; nonetheless, back-patch to v13 where the mistake was introduced. Ranier Vilela Discussion: https://postgr.es/m/CAEudQAqXuhbkaAp-sGH6dR6Nsq7v28_0TPexHOm6FiDYqwQD-w@mail.gmail.com
1 parent 08cfa59 commit 16a5677

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/executor/execExpr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3121,6 +3121,8 @@ ExecInitCoerceToDomain(ExprEvalStep *scratch, CoerceToDomain *ctest,
31213121
ExprState *state, Datum *resv, bool *resnull)
31223122
{
31233123
DomainConstraintRef *constraint_ref;
3124+
Datum *domainval = NULL;
3125+
bool *domainnull = NULL;
31243126
ListCell *l;
31253127

31263128
scratch->d.domaincheck.resulttype = ctest->resulttype;
@@ -3167,8 +3169,6 @@ ExecInitCoerceToDomain(ExprEvalStep *scratch, CoerceToDomain *ctest,
31673169
foreach(l, constraint_ref->constraints)
31683170
{
31693171
DomainConstraintState *con = (DomainConstraintState *) lfirst(l);
3170-
Datum *domainval = NULL;
3171-
bool *domainnull = NULL;
31723172
Datum *save_innermost_domainval;
31733173
bool *save_innermost_domainnull;
31743174

0 commit comments

Comments
 (0)