Commit 1bbe55c7 authored by Jan Wieck's avatar Jan Wieck

Just one more bugfix - this time in cmp_abs (cannot imagine that

taking a logarithm with a 400 digit precision worked with that bug
in place).

Jan
parent c1855793
......@@ -5,7 +5,7 @@
*
* 1998 Jan Wieck
*
* $Header: /cvsroot/pgsql/src/backend/utils/adt/numeric.c,v 1.7 1999/01/04 12:53:23 wieck Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/numeric.c,v 1.8 1999/01/04 17:51:58 wieck Exp $
*
* ----------
*/
......@@ -3438,17 +3438,19 @@ cmp_abs(NumericVar *var1, NumericVar *var2)
int w2 = var2->weight;
int stat;
while (w1 > w2)
while (w1 > w2 && i1 < var1->ndigits)
{
if (var1->digits[i1++] != 0) return 1;
w1--;
}
while (w2 > w1)
while (w2 > w1 && i2 < var2->ndigits)
{
if (var2->digits[i2++] != 0) return -1;
w2--;
}
if (w1 == w2)
{
while (i1 < var1->ndigits && i2 < var2->ndigits)
{
stat = var1->digits[i1++] - var2->digits[i2++];
......@@ -3459,6 +3461,7 @@ cmp_abs(NumericVar *var1, NumericVar *var2)
return -1;
}
}
}
while (i1 < var1->ndigits)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment