pgsql: Fix incorrect logic in plan dependency recording

From: David Rowley <drowley(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix incorrect logic in plan dependency recording
Date: 2023-09-13 23:28:11
Message-ID: E1qgZHH-003h4X-4W@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/ee3a551e96c465f96de04dd1faf4e7bff8d25342

Modified Files
--------------
src/backend/optimizer/plan/setrefs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message David Rowley 2023-09-13 23:28:36 pgsql: Fix incorrect logic in plan dependency recording
Previous Message Amit Kapila 2023-09-13 04:28:31 pgsql: Fix the ALTER SUBSCRIPTION to reflect the change in run_as_owner