Re: extend pgbench expressions with functions - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: extend pgbench expressions with functions
Date
Msg-id CAB7nPqQFqOO5PUMMjS9xvT0hiw+8YTsTZzYZqKwOsqJYoogJTA@mail.gmail.com
Whole thread Raw
In response to Re: extend pgbench expressions with functions  (Fabien COELHO <coelho@cri.ensmp.fr>)
Responses Re: extend pgbench expressions with functions  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On Fri, Jan 29, 2016 at 11:21 PM, Fabien COELHO <coelho@cri.ensmp.fr> wrote:
> +            /* overflow check (needed for INT64_MIN) */
> +            if (lval != 0 && (*retval < 0 == lval < 0))
>
> Why not use "if (lval == INT64_MIN)" instead of this complicated condition?
> If it is really needed for some reason, I think that a comment could help.

Checking for PG_INT64_MIN only would be fine as well, so let's do so.
I thought honestly that we had better check if the result and the left
argument are not of the same sign, but well.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Template for commit messages
Next
From: Robert Haas
Date:
Subject: Re: Fwd: Core dump with nested CREATE TEMP TABLE