pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <dgrowleyml@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Surely this code in setrefs.c is wrong?
Date: Sat, 09 Sep 2023 19:22:52 -0400
Message-ID: <2277537.1694301772@sss.pgh.pa.us> (raw)

I happened to notice this bit in fix_expr_common's processing
of ScalarArrayOpExprs:

        set_sa_opfuncid(saop);
        record_plan_function_dependency(root, saop->opfuncid);

        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.
As-is, the code's a no-op because record_plan_function_dependency
will ignore OIDs less than FirstUnpinnedObjectId, including zero.

"git blame" blames 50e17ad28 and 29f45e299 for these, so v14
has only half the problem of later branches.

			regards, tom lane





view thread (3+ messages)  latest in thread

Message-ID: <2277537.1694301772@sss.pgh.pa.us>
Permalink:  ../2277537.1694301772@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2277537.1694301772@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, dgrowleyml@gmail.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: Surely this code in setrefs.c is wrong?
  In-Reply-To: <2277537.1694301772@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox