Commit 2a1ef30b authored by Tom Lane's avatar Tom Lane

Prevent infinite loop in ln_var() due to roundoff error.

Per report from Dave Marin.
parent 6c4996fa
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* *
* 1998 Jan Wieck * 1998 Jan Wieck
* *
* $Header: /cvsroot/pgsql/src/backend/utils/adt/numeric.c,v 1.57 2003/03/11 21:01:33 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/numeric.c,v 1.58 2003/03/14 00:15:32 tgl Exp $
* *
* ---------- * ----------
*/ */
...@@ -3872,6 +3872,9 @@ ln_var(NumericVar *arg, NumericVar *result) ...@@ -3872,6 +3872,9 @@ ln_var(NumericVar *arg, NumericVar *result)
break; break;
add_var(result, &elem, result); add_var(result, &elem, result);
if (elem.weight < (result->weight - 2 * global_rscale))
break;
} }
/* Compensate for argument range reduction, round to caller's rscale */ /* Compensate for argument range reduction, round to caller's rscale */
......
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