Skip to content

Commit 1a6900e

Browse files
committed
Fix incorrect logic in plan dependency recording
Both 50e17ad and 29f45e2 mistakenly tried to record a plan dependency on a function but mistakenly inverted the OidIsValid test. This meant that we'd record a dependency only when the function's Oid was InvalidOid. Clearly this was meant to *not* record the dependency in that case. 50e17ad made this mistake first, then in v15 29f45e2 copied the same mistake. Reported-by: Tom Lane Backpatch-through: 14, where 50e17ad first made this mistake Discussion: https://postgr.es/m/2277537.1694301772@sss.pgh.pa.us
1 parent a81e551 commit 1a6900e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/optimizer/plan/setrefs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1979,10 +1979,10 @@ fix_expr_common(PlannerInfo *root, Node *node)
19791979
set_sa_opfuncid(saop);
19801980
record_plan_function_dependency(root, saop->opfuncid);
19811981

1982-
if (!OidIsValid(saop->hashfuncid))
1982+
if (OidIsValid(saop->hashfuncid))
19831983
record_plan_function_dependency(root, saop->hashfuncid);
19841984

1985-
if (!OidIsValid(saop->negfuncid))
1985+
if (OidIsValid(saop->negfuncid))
19861986
record_plan_function_dependency(root, saop->negfuncid);
19871987
}
19881988
else if (IsA(node, Const))

0 commit comments

Comments
 (0)