Re: Surely this code in setrefs.c is wrong?

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Surely this code in setrefs.c is wrong?
Date: 2023-09-10 09:07:53
Message-ID: CAApHDvrkPmneRV_c9RfUom+6KoH39qpC2py-oN==SaRrVJch7g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, 10 Sept 2023 at 11:22, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Lakhin 2023-09-10 10:00:00 Re: Cleaning up array_in()
Previous Message Tom Lane 2023-09-09 23:22:52 Surely this code in setrefs.c is wrong?