Skip to content

Commit 01fc652

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 7d9ec07 commit 01fc652

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
@@ -3137,6 +3137,8 @@ ExecInitCoerceToDomain(ExprEvalStep *scratch, CoerceToDomain *ctest,
31373137
ExprState *state, Datum *resv, bool *resnull)
31383138
{
31393139
DomainConstraintRef *constraint_ref;
3140+
Datum *domainval = NULL;
3141+
bool *domainnull = NULL;
31403142
ListCell *l;
31413143

31423144
scratch->d.domaincheck.resulttype = ctest->resulttype;
@@ -3183,8 +3185,6 @@ ExecInitCoerceToDomain(ExprEvalStep *scratch, CoerceToDomain *ctest,
31833185
foreach(l, constraint_ref->constraints)
31843186
{
31853187
DomainConstraintState *con = (DomainConstraintState *) lfirst(l);
3186-
Datum *domainval = NULL;
3187-
bool *domainnull = NULL;
31883188
Datum *save_innermost_domainval;
31893189
bool *save_innermost_domainnull;
31903190

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy