From: | Ranier Vilela <ranier(dot)vf(at)gmail(dot)com> |
---|---|
To: | Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org> |
Cc: | pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | Re: [PATCH] Fix expressions always false |
Date: | 2019-12-20 00:42:06 |
Message-ID: | CAEudQAp9AtTtRYV0vSXZQCF08QZSn4jiym2SJJ71rE1LuPF7yg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
>1) long is 64 bits on Unix-like platforms
>2) checking a long against LONG_MIN/LONG_MAX is _definitely_ pointless
>3) it's being cast to an int for the from_char_set_int() call below
>Please take your time to read the whole context of the code you're
>changing, and consider other platforms than just Windows.
Thank you for point me, about this.
regards,
Ranier Vilela
Em qui., 19 de dez. de 2019 às 20:58, Dagfinn Ilmari Mannsåker <
ilmari(at)ilmari(dot)org> escreveu:
> Ranier Vilela <ranier(dot)vf(at)gmail(dot)com> writes:
>
> > More about expressions always false.
> > 2. src/backend/utils/adt/formatting.c
> > result is declared long. Comparison with int limits is always false.
> > 3. src/backend/utils/adt/jsonfuncs.c
> > lindex is declared long. . Comparison with int limits is always false.
>
> 1) long is 64 bits on Unix-like platforms
> 2) checking a long against LONG_MIN/LONG_MAX is _definitely_ pointless
> 3) it's being cast to an int for the from_char_set_int() call below
>
> Please take your time to read the whole context of the code you're
> changing, and consider other platforms than just Windows.
>
> - ilmari
> --
> "A disappointingly low fraction of the human race is,
> at any given time, on fire." - Stig Sandbeck Mathisen
>
Attachment | Content-Type | Size |
---|---|---|
always_false_v2.patch | text/x-patch | 1.0 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Andreas Karlsson | 2019-12-20 00:54:53 | Re: More issues with expressions always false (no patch) |
Previous Message | tsunakawa.takay@fujitsu.com | 2019-12-20 00:41:21 | RE: Libpq support to connect to standby server as priority |