Re: Check for integer overflow in datetime functions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Fuhr <mike(at)fuhr(dot)org>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Check for integer overflow in datetime functions
Date: 2005-12-01 17:59:16
Message-ID: 15156.1133459956@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Michael Fuhr <mike(at)fuhr(dot)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

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Greg Stark 2005-12-01 18:16:42 Re: Strange interval arithmetic
Previous Message Qingqing Zhou 2005-12-01 17:52:48 Re: [PATCHES] A couple of proposed pgbench changes