mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-12 18:34:36 +08:00
Fix variable lifespan in ExecInitCoerceToDomain().
This undoes a mistake in 1ec7679f1
: 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
This commit is contained in:
parent
7d9ec0754a
commit
01fc652703
@ -3137,6 +3137,8 @@ ExecInitCoerceToDomain(ExprEvalStep *scratch, CoerceToDomain *ctest,
|
|||||||
ExprState *state, Datum *resv, bool *resnull)
|
ExprState *state, Datum *resv, bool *resnull)
|
||||||
{
|
{
|
||||||
DomainConstraintRef *constraint_ref;
|
DomainConstraintRef *constraint_ref;
|
||||||
|
Datum *domainval = NULL;
|
||||||
|
bool *domainnull = NULL;
|
||||||
ListCell *l;
|
ListCell *l;
|
||||||
|
|
||||||
scratch->d.domaincheck.resulttype = ctest->resulttype;
|
scratch->d.domaincheck.resulttype = ctest->resulttype;
|
||||||
@ -3183,8 +3185,6 @@ ExecInitCoerceToDomain(ExprEvalStep *scratch, CoerceToDomain *ctest,
|
|||||||
foreach(l, constraint_ref->constraints)
|
foreach(l, constraint_ref->constraints)
|
||||||
{
|
{
|
||||||
DomainConstraintState *con = (DomainConstraintState *) lfirst(l);
|
DomainConstraintState *con = (DomainConstraintState *) lfirst(l);
|
||||||
Datum *domainval = NULL;
|
|
||||||
bool *domainnull = NULL;
|
|
||||||
Datum *save_innermost_domainval;
|
Datum *save_innermost_domainval;
|
||||||
bool *save_innermost_domainnull;
|
bool *save_innermost_domainnull;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user