Re: Check for integer overflow in datetime functions - Mailing list pgsql-patches

From Tom Lane
Subject Re: Check for integer overflow in datetime functions
Date
Msg-id 15156.1133459956@sss.pgh.pa.us
Whole thread Raw
In response to Check for integer overflow in datetime functions  (Michael Fuhr <mike@fuhr.org>)
List pgsql-patches
Michael Fuhr <mike@fuhr.org> writes:
> Check integer conversion for overflow in datetime functions.

Applied back to 7.4.  The patch would not work in 7.3 because we didn't
have the DTERR_ convention back then, and it seems not worth the effort
to try to deal with the problem that far back.

> In one place (line 60 in the patch) the code sets errno to 0 when
> it should still be 0 after similar code a few lines above (otherwise
> the function would have returned an error).  I wasn't sure what
> would be preferred: clearing errno again "just to be sure," a comment
> explaining why it isn't necessary, or nothing at all.

I left it as-is ...

            regards, tom lane

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: Check for integer overflow in datetime functions
Next
From: Tom Lane
Date:
Subject: Fork-based version of pgbench