Re: Bitwise OR instead of logical one in test_aio.c

From: Xuneng Zhou <xunengzhou(at)gmail(dot)com>
To: Mikhail Gribkov <youzhick(at)gmail(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Bitwise OR instead of logical one in test_aio.c
Date: 2026-11-26 01:39:33
Message-ID: CABPTF7WhuqPcnP6H-yfeL5zVrsSBG6VYr+=8_zZUFH=sJLj7AA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Mikhail,

On Thu, Nov 26, 2026 at 5:02 AM Mikhail Gribkov <youzhick(at)gmail(dot)com> wrote:
>
> Hi hackers,
>
> I've noticed an odd check in test_aio.c:
> if (zero_on_error | zero_damaged_pages)
> srb_flags |= READ_BUFFERS_ZERO_ON_ERROR;
>
> Both zero_on_error and zero_damaged_pages declared as bool. Shouldn't there be a logical "||" inside the if-condition, not a bitwise "|"?
> Yes, it works now, but fixing it would be cleaner.
>
> Proposed patch is attached (although it's quite trivial).

AI found another one in FuncnameGetCandidates() in namespace.c:

Assert(nargs >= 0 || !(expand_variadic | expand_defaults));

I think they belong to the same category and could be addressed together.

--
Regards,
Xuneng Zhou
HighGo Software Co., Ltd.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2026-11-26 01:43:50 Re: Should we skip foreign key checks in binary upgrade mode?
Previous Message Chao Li 2026-11-26 00:39:15 Re: repack: clarify final phase of concurrent mode in file header comment