Re: extend pgbench expressions with functions

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: extend pgbench expressions with functions
Date: 2016-01-30 12:36:27
Message-ID: CAB7nPqQFqOO5PUMMjS9xvT0hiw+8YTsTZzYZqKwOsqJYoogJTA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jan 29, 2016 at 11:21 PM, Fabien COELHO <coelho(at)cri(dot)ensmp(dot)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 Content-Type Size
pgbench-div-crash-v3.patch text/x-diff 1.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2016-01-30 12:37:45 Re: Fwd: Core dump with nested CREATE TEMP TABLE
Previous Message Alvaro Herrera 2016-01-30 10:22:50 Re: Template for commit messages