Re: Fix typo with logical connector (src/backend/commands/vacuumparallel.c) - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: Fix typo with logical connector (src/backend/commands/vacuumparallel.c)
Date
Msg-id CAA4eK1LxmibSzO38Z_f5z8cVrL+KP8q7FZYWaDaNje3kats37Q@mail.gmail.com
Whole thread Raw
In response to Re: Fix typo with logical connector (src/backend/commands/vacuumparallel.c)  (Ranier Vilela <ranier.vf@gmail.com>)
Responses Re: Fix typo with logical connector (src/backend/commands/vacuumparallel.c)
Re: Fix typo with logical connector (src/backend/commands/vacuumparallel.c)
List pgsql-hackers
On Fri, Aug 19, 2022 at 7:45 PM Ranier Vilela <ranier.vf@gmail.com> wrote:
>
> Em sex., 19 de ago. de 2022 às 10:28, Tom Lane <tgl@sss.pgh.pa.us> escreveu:
>>
>> Ranier Vilela <ranier.vf@gmail.com> writes:
>> > At function parallel_vacuum_process_all_indexes there is
>> > a typo with a logical connector.
>> > I think that correct is &&, because both of the operators are
>> > bool types [1].
>> > As a result, parallel vacuum workers can be incorrectly enabled.
>>
>> Since they're bools, the C spec requires them to promote to integer
>> 0 or 1, therefore the & operator will yield the desired result.
>> So there's not going to be any incorrect behavior.
>
>
> So, my assumption is incorrect.
>

Right, but as Tom pointed it is still better to change this. However,
I am not sure if we should backpatch this to PG15 as this won't lead
to any incorrect behavior.

--
With Regards,
Amit Kapila.



pgsql-hackers by date:

Previous
From: Cary Huang
Date:
Subject: sslinfo extension - add notbefore and notafter timestamps
Next
From: "Euler Taveira"
Date:
Subject: Re: including pid's for `There are XX other sessions using the database`