Re: new int8 test still has problems

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: new int8 test still has problems
Date: 2008-10-05 19:04:22
Message-ID: 8364.1223233462@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> This result from AIX/PPC can't be good, however:

Hmm. The test in int84div is

/*
* Overflow check. The only possible overflow case is for arg1 =
* INT64_MIN, arg2 = -1, where the correct result is -INT64_MIN, which
* can't be represented on a two's-complement machine.
*/
if (arg2 == -1 && arg1 < 0 && result < 0)
ereport(ERROR,
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
errmsg("bigint out of range")));

Maybe we could use "result <= 0" for the third check? Surely a zero
result cannot be correct given the first two checks.

The other integer division functions should be looked at too.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dickson S. Guedes 2008-10-05 20:55:33 Re: Common Table Expressions applied; some issues remain
Previous Message Peter Eisentraut 2008-10-05 18:58:24 Re: new int8 test still has problems