Re: pgsql: Add infrastructure to support EphemeralNamedRelation references.

From: Kevin Grittner <kgrittn(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Kevin Grittner <kgrittn(at)postgresql(dot)org>, "pgsql-committers(at)postgresql(dot)org" <pgsql-committers(at)postgresql(dot)org>
Subject: Re: pgsql: Add infrastructure to support EphemeralNamedRelation references.
Date: 2017-04-06 22:20:36
Message-ID: CACjxUsPEM9izrnQE-jCO+Axuj9GP0XEwdk1jCLLRqcuaEhbT0w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On Thu, Apr 6, 2017 at 5:07 PM, Thomas Munro
<thomas(dot)munro(at)enterprisedb(dot)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(at)anarazel(dot)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

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2017-04-06 22:21:00 Re: pgsql: Add infrastructure to support EphemeralNamedRelation references.
Previous Message Andres Freund 2017-04-06 22:16:47 Re: pgsql: Add infrastructure to support EphemeralNamedRelation references.