Re: Small miscellaneus fixes (Part II)

From: John Naylor <john(dot)naylor(at)enterprisedb(dot)com>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Small miscellaneus fixes (Part II)
Date: 2023-01-12 05:15:24
Message-ID: CAFBsxsEhZCcN2_-sJZgopJ2khqp1wAtjS3Ziery35OxDtssNWg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Dec 23, 2022 at 8:08 AM Justin Pryzby <pryzby(at)telsasoft(dot)com> wrote:

> Makes sense now (in your first message, you said that the problem was
> with "sign", and the patch didn't address the actual problem in
> IS_PLUS()).
>
> One can look and find that the unreachable code was introduced at
> 7a3e7b64a.
>
> With your proposed change, the unreachable line is hit by regression
> tests, which is an improvment. As is the change to pg_dump.c.

But that now reachable line just unsets a flag that we previously found
unset, right?
And if that line was unreachable, then surely the previous flag-clearing
operation is too?

5669 994426 : if (IS_MINUS(Np->Num)) // <- also always
false
5670 0 : Np->Num->flag &= ~NUM_F_MINUS;
5671 : }
5672 524 : else if (Np->sign != '+' && IS_PLUS(Np->Num))
5673 0 : Np->Num->flag &= ~NUM_F_PLUS;

https://coverage.postgresql.org/src/backend/utils/adt/formatting.c.gcov.html

I'm inclined to turn the dead unsets into asserts.

--
John Naylor
EDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2023-01-12 05:20:16 resend from mailing list archive doesn't working
Previous Message Justin Pryzby 2023-01-12 05:12:43 Re: on placeholder entries in view rule action query's range table