remove unnecessary assignment to tmask in DecodeDateTime

From: Zhihong Yu <zyu(at)yugabyte(dot)com>
To: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: remove unnecessary assignment to tmask in DecodeDateTime
Date: 2022-11-03 17:04:44
Message-ID: CALNJ-vTnQSK=aZxDaWUj=ikXS3f6_yB8G0pFp5gScs3Se2r+Vw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,
I was looking at the code in DecodeDateTime() around line 1382:

tmask = DTK_M(type);

In case type is UNKNOWN_FIELD, the above macro would shift 1 left 31 bits
which cannot be represented in type 'int'.

Looking down in the same function, we can see that tmask is assigned for
every legitimate case.

If my understanding is correct, please take a look at the proposed patch.

Thanks

Attachment Content-Type Size
tmask-decode-date-time.patch application/octet-stream 384 bytes

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2022-11-03 17:21:23 Re: remap the .text segment into huge pages at run time
Previous Message Melanie Plageman 2022-11-03 17:00:24 Re: pg_stat_bgwriter.buffers_backend is pretty meaningless (and more?)