1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-27 23:21:58 +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:32 +00:00
parent 6c4996fa6b
commit 2a1ef30b57

View File

@ -5,7 +5,7 @@
*
* 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)
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 */