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-29 06:56:50
Message-ID: CAB7nPqS9mpSk7WvUOETSfeD_b0bDri7zgK0B0m59PeDpPqxdAA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jan 29, 2016 at 3:40 PM, Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr> wrote:

>
> I would as well suggest fixing first the (INT64_MAX / -1) crash on HEAD
>> and back-branches with something like the patch attached, inspired from
>> int8.c.
>>
>
> I think it is overkill, but do as you feel.
>

Perhaps we could have Robert decide on this one first? That's a bug after
all that had better be backpatched.

> Note that it must also handle modulo, but the code you suggest cannot be
> used for that.
>
> #include <stdint.h>
> int main(int argc, char* argv[])
> {
> int64_t l = INT64_MIN;
> int64_t r = -1;
> int64_t d = l % r;
> return 0;
> }
> // => Floating point exception (core dumped)
>

Right, forgot this one, we just need to check if rval is -1 here, and
return 0 as result. I am updating the fix as attached.
--
Michael

Attachment Content-Type Size
pgbench-div-crash-v2.patch text/x-diff 1.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2016-01-29 07:00:34 Re: insufficient qualification of some objects in dump files
Previous Message Tom Lane 2016-01-29 06:51:04 Re: insufficient qualification of some objects in dump files