Re: [COMMITTERS] pgsql: Add infrastructure to supportEphemeralNamedRelation references. - Mailing list pgsql-committers

From Kevin Grittner
Subject Re: [COMMITTERS] pgsql: Add infrastructure to supportEphemeralNamedRelation references.
Date
Msg-id CACjxUsPEM9izrnQE-jCO+Axuj9GP0XEwdk1jCLLRqcuaEhbT0w@mail.gmail.com
Whole thread Raw
In response to Re: [COMMITTERS] pgsql: Add infrastructure to supportEphemeralNamedRelation references.  (Andres Freund <andres@anarazel.de>)
Responses Re: [COMMITTERS] pgsql: Add infrastructure to supportEphemeralNamedRelation references.  (Kevin Grittner <kgrittn@gmail.com>)
List pgsql-committers
On Thu, Apr 6, 2017 at 5:07 PM, Thomas Munro
<thomas.munro@enterprisedb.com> wrote:

> Doesn't it also have the logic backwards?  According to the comment,
> the attribute is dropped if the type *is* InvalidOid, so we want
> result == true in that case.  But I don't actually know how to reach
> this code to test it.

You're right.  So on this one line I had a reverse logic bug,
something that strict compilers would not accept, and code that
assumed that readers and compilers would always know that tests for
equality or inequality bind tighter than assignment.

I'll commit this fix first so I don't hold up Andres or break any
picky buildfarm critters and then see whether I can't manage to get
the tests to cover this code.

Thanks!


On Thu, Apr 6, 2017 at 5:16 PM, Andres Freund <andres@anarazel.de> wrote:
> On 2017-04-06 17:03:20 -0500, Kevin Grittner wrote:
>> Out of curiosity, what compiler or setting catches this?
>
> gcc-7 here, and the specific warning is -Wpointer-compare.

Thanks!  I'll add that to my builds.

--
Kevin Grittner


pgsql-committers by date:

Previous
From: Andres Freund
Date:
Subject: Re: [COMMITTERS] pgsql: Add infrastructure to supportEphemeralNamedRelation references.
Next
From: Tom Lane
Date:
Subject: Re: [COMMITTERS] pgsql: Add infrastructure to support EphemeralNamedRelation references.