diff options
author | David Rowley <drowley@postgresql.org> | 2023-09-14 11:27:29 +1200 |
---|---|---|
committer | David Rowley <drowley@postgresql.org> | 2023-09-14 11:27:29 +1200 |
commit | ee3a551e96c465f96de04dd1faf4e7bff8d25342 (patch) | |
tree | f44a8158b5ab3c66346f6ae891f59cde91fe12e1 /src/backend/optimizer/plan/setrefs.c | |
parent | f062cddafe6b3dcb6d090111c7cd4afa0c7fa4b3 (diff) | |
download | postgresql-ee3a551e96c465f96de04dd1faf4e7bff8d25342.tar.gz postgresql-ee3a551e96c465f96de04dd1faf4e7bff8d25342.zip |
Fix incorrect logic in plan dependency recording
Both 50e17ad28 and 29f45e299 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.
50e17ad28 made this mistake first, then in v15 29f45e299 copied the same
mistake.
Reported-by: Tom Lane
Backpatch-through: 14, where 50e17ad28 first made this mistake
Discussion: https://postgr.es/m/2277537.1694301772@sss.pgh.pa.us
Diffstat (limited to 'src/backend/optimizer/plan/setrefs.c')
-rw-r--r-- | src/backend/optimizer/plan/setrefs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/optimizer/plan/setrefs.c b/src/backend/optimizer/plan/setrefs.c index 97fa561e4ea..5700bfb5cd2 100644 --- a/src/backend/optimizer/plan/setrefs.c +++ b/src/backend/optimizer/plan/setrefs.c @@ -1991,10 +1991,10 @@ fix_expr_common(PlannerInfo *root, Node *node) set_sa_opfuncid(saop); record_plan_function_dependency(root, saop->opfuncid); - if (!OidIsValid(saop->hashfuncid)) + if (OidIsValid(saop->hashfuncid)) record_plan_function_dependency(root, saop->hashfuncid); - if (!OidIsValid(saop->negfuncid)) + if (OidIsValid(saop->negfuncid)) record_plan_function_dependency(root, saop->negfuncid); } else if (IsA(node, Const)) |