Tom Lane wrote:
{
int32 arg1 = PG_GETARG_INT32(0);
int32 arg2 = PG_GETARG_INT32(1);
+ int32 result;
! result = arg1 * arg2;
! /*
! * Overflow check. We basically check to see if result / arg2 gives
! * arg1 again. There are two cases where this fails: arg2 = 0 (which
! * ca
On Sun, Oct 03, 2004 at 15:38:52 -0400,
Tom Lane <[EMAIL PROTECTED]> wrote:
> 1. Does anyone object to applying this for 8.0? I think we already had
> consensus that it's a good idea, but if not now's the time to speak up.
> (There are a couple of regression tests that fail and will need to be
>
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Tom Lane
> Sent: 03 October 2004 20:39
> To: [EMAIL PROTECTED]
> Subject: [HACKERS] Checking for overflow of integer arithmetic
>
> 2. For the int2 and int8 operators, should we stick to a
> one-si