Re: Surely this code in setrefs.c is wrong? - Mailing list pgsql-hackers

From David Rowley
Subject Re: Surely this code in setrefs.c is wrong?
Date
Msg-id CAApHDvrkPmneRV_c9RfUom+6KoH39qpC2py-oN==SaRrVJch7g@mail.gmail.com
Whole thread Raw
In response to Surely this code in setrefs.c is wrong?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Surely this code in setrefs.c is wrong?
List pgsql-hackers
On Sun, 10 Sept 2023 at 11:22, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>         if (!OidIsValid(saop->hashfuncid))
>             record_plan_function_dependency(root, saop->hashfuncid);
>
>         if (!OidIsValid(saop->negfuncid))
>             record_plan_function_dependency(root, saop->negfuncid);
>
> Surely those if-conditions are exactly backward, and we should be
> recording nonzero hashfuncid and negfuncid entries, not zero ones.

That's certainly not coded as I intended. Perhaps I got my wires
crossed and mixed up OidIsValid and InvalidOid and without reading
correctly somehow thought OidIsValid was for the inverse case.

I'll push fixes once the 16.0 release is out of the way.

David



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Surely this code in setrefs.c is wrong?
Next
From: Alexander Lakhin
Date:
Subject: Re: Cleaning up array_in()