casting operand to proper type in BlockIdGetBlockNumber

From: Zhihong Yu <zyu(at)yugabyte(dot)com>
To: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: casting operand to proper type in BlockIdGetBlockNumber
Date: 2022-03-03 15:34:08
Message-ID: CALNJ-vT9r0DSsAOw9OXVJFxLENoVS_68kJ5x0p44atoYH+H4dg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,
In test output, I saw:

src/backend/utils/adt/tid.c:112:16: runtime error: left shift of 65535 by
16 places cannot be represented in type 'int'

I think this was due to the left shift in BlockIdGetBlockNumber not
properly casting its operand.

Please see the proposed change in patch.

Thanks

Attachment Content-Type Size
get-block-number.patch application/octet-stream 535 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Julien Rouhaud 2022-03-03 15:40:26 Re: Problem with moderation of messages with patched attached.
Previous Message Tom Lane 2022-03-03 15:17:06 Re: Problem with moderation of messages with patched attached.