Re: Lots of incorrect comments in nodeFuncs.c

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Lots of incorrect comments in nodeFuncs.c
Date: 2021-04-08 23:25:49
Message-ID: CAApHDvoCkOQze=f__TQ2uq2SOdWRqx-TNf9m2PQERPdppmWxNA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 9 Apr 2021 at 10:11, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> David Rowley <dgrowleyml(at)gmail(dot)com> writes:
> > I noticed that nodeFuncs.c appears to have some pretty sloppy work
> > done in many of the comments. Many look like they've just not been
> > updated from a copy/paste/edit from another node function.
> > The attached aims to clean these up.
>
> I believe every one of these changes is wrong.
> For instance:
>
> case T_ScalarArrayOpExpr:
> - coll = InvalidOid; /* result is always boolean */
> + coll = InvalidOid; /* result is always InvalidOid */
> break;
>
> The point here is that the result type of ScalarArrayOpExpr is boolean,
> which has no collation, therefore reporting its collation as InvalidOid
> is correct. Maybe there's a clearer way to say that, but your text is
> more confusing not less so.

hmm ok. I imagine there must be a better way to say that then since
it confused at least 1 reader so far. My problem is that I assumed
"result" meant the result of the function that the comment is written
in, not the result of evaluating the given expression during
execution. If that was more clear then I'd not have been misled.

David

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2021-04-08 23:39:46 Re: test runner (was Re: SQL-standard function body)
Previous Message David Rowley 2021-04-08 23:21:23 Re: Binary search in ScalarArrayOpExpr for OR'd constant arrays