Bitwise OR instead of logical one in test_aio.c

From: Mikhail Gribkov <youzhick(at)gmail(dot)com>
To: Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Bitwise OR instead of logical one in test_aio.c
Date: 2026-11-25 21:02:31
Message-ID: CAMEv5_uzqc9=anZvJBvhXtd1ry3x71nDZn_irTq4uuAuD_qSqA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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).

--
best regards,
Mikhail A. Gribkov

Attachment Content-Type Size
001_Fix_bitwise_operation_on_bools.patch application/octet-stream 550 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrey Rachitskiy 2026-11-25 21:14:33 Re: Fix OOM when rendering large geometry arrays
Previous Message Nathan Bossart 2026-11-25 20:42:37 Re: passwordcheck: Make the user name check case-insensitive