Re: Missing PG_INT32_MIN in numutils.c

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Missing PG_INT32_MIN in numutils.c
Date: 2016-04-13 12:21:29
Message-ID: CAB7nPqRRfW+vrrVEMy0ZDm3pQ6Xy6xA15-Th-VAOv8M1cLEeyw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Apr 13, 2016 at 8:57 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Wed, Apr 13, 2016 at 3:49 AM, Michael Paquier
> <michael(dot)paquier(at)gmail(dot)com> wrote:
>> Hi all,
>>
>> While going through numutils.c I found the following thing:
>> --- a/src/backend/utils/adt/numutils.c
>> +++ b/src/backend/utils/adt/numutils.c
>> @@ -136,7 +136,7 @@ pg_ltoa(int32 value, char *a)
>> * Avoid problems with the most negative integer not being representable
>> * as a positive integer.
>> */
>> - if (value == (-2147483647 - 1))
>> + if (value == PG_INT32_MIN)
>> {
>> memcpy(a, "-2147483648", 12);
>> return;
>> Attached is a patch. The interesting part is that pg_lltoa is not
>> missing the check on PG_INT64_MIN.
>
> Committed.

Thanks.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2016-04-13 12:29:25 Re: pg_upgrade documentation improvement patch
Previous Message Michael Paquier 2016-04-13 12:20:57 Re: Why doesn't src/backend/port/win32/socket.c implement bind()?