Remove useless int64 range checks on BIGINT sequence MINVALUE/MAXVALUE values - Mailing list pgsql-hackers

From Greg Nancarrow
Subject Remove useless int64 range checks on BIGINT sequence MINVALUE/MAXVALUE values
Date
Msg-id CAJcOf-c9KBUZ8ow_6e=WSfbbEyTKfqV=VwoFuODQVYMySHtusw@mail.gmail.com
Whole thread Raw
Responses Re: Remove useless int64 range checks on BIGINT sequence MINVALUE/MAXVALUE values  (David Rowley <dgrowleyml@gmail.com>)
List pgsql-hackers
Hi,

Sequence MINVALUE/MAXVALUE values are read into "int64" variables and
then range-checked according to the sequence data-type.
However, for a BIGINT sequence, checking whether these are <
PG_INT64_MIN or > PG_INT64_MAX always evaluates to false, as an int64
can't hold such values.
I've attached a patch to remove those useless checks.
The MINVALUE/MAXVALUE values are anyway int64 range-checked prior to
this, as part of conversion to int64.

Regards,
Greg Nancarrow
Fujitsu Australia

Attachment

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Fix for segfault in logical replication on master
Next
From: Andres Freund
Date:
Subject: Re: seawasp failing, maybe in glibc allocator