Re: Suspicious strcmp() in src/backend/parser/parse_expr.c

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>, Rikard Falkeborn <rikard(dot)falkeborn(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: Suspicious strcmp() in src/backend/parser/parse_expr.c
Date: 2019-04-11 03:26:31
Message-ID: CA+hUKGJScU-ciKbjW_5Xf-sQXbuy8qH0iHSCBL_+2BuW8xSQNg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Apr 11, 2019 at 2:20 PM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
> On Wed, Apr 10, 2019 at 06:43:32PM -0400, Tom Lane wrote:
> > Indeed. Considering how much I hate using strcmp's result as a boolean,
> > you'd think I'd have got that right. Thanks for noticing!
>
> Just a note about those strcmp() calls using a boolean as return
> result in the tree:
> src/backend/commands/lockcmds.c: (!strcmp(rte->eref->aliasname, "old")

Don't look at contrib/spi/refint.c if you value your sanity.

--
Thomas Munro
https://enterprisedb.com

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message r.zharkov 2019-04-11 03:29:03 Re: BUG #15727: PANIC: cannot abort transaction 295144144, it was already committed
Previous Message Michael Paquier 2019-04-11 03:07:12 Re: BUG #15734: Walsender process crashing when executing SHOW ALL;