1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-09 13:09:39 +03:00

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

Per report from Dave Marin.
This commit is contained in:
Tom Lane
2003-03-14 00:15:41 +00:00
parent d144f96bf0
commit cebedc36ed

View File

@@ -5,7 +5,7 @@
*
* 1998 Jan Wieck
*
* $Header: /cvsroot/pgsql/src/backend/utils/adt/numeric.c,v 1.56 2002/10/19 02:08:17 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/numeric.c,v 1.56.2.1 2003/03/14 00:15:41 tgl Exp $
*
* ----------
*/
@@ -3872,6 +3872,9 @@ ln_var(NumericVar *arg, NumericVar *result)
break;
add_var(result, &elem, result);
if (elem.weight < (result->weight - 2 * global_rscale))
break;
}
/* Compensate for argument range reduction, round to caller's rscale */