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

From Michael Paquier
Subject Re: extend pgbench expressions with functions
Date
Msg-id CAB7nPqS9mpSk7WvUOETSfeD_b0bDri7zgK0B0m59PeDpPqxdAA@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  (Fabien COELHO <coelho@cri.ensmp.fr>)
List pgsql-hackers


On Fri, Jan 29, 2016 at 3:40 PM, Fabien COELHO <coelho@cri.ensmp.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

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: insufficient qualification of some objects in dump files
Next
From: Michael Paquier
Date:
Subject: Re: insufficient qualification of some objects in dump files