Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 814c849

Browse files
Jan WieckJan Wieck
Jan Wieck
authored and
Jan Wieck
committed
Removed precision restriction in numeric_round() causing
overflow error on high precision calculations where temporary huge precision is required. Jan
1 parent 8aad28d commit 814c849

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/backend/utils/adt/numeric.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* 1998 Jan Wieck
77
*
8-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/numeric.c,v 1.8 1999/01/04 17:51:58 wieck Exp $
8+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/numeric.c,v 1.9 1999/01/05 11:10:45 wieck Exp $
99
*
1010
* ----------
1111
*/
@@ -555,7 +555,6 @@ numeric_round(Numeric num, int32 scale)
555555
* ----------
556556
*/
557557
precision = MAX(0, num->n_weight) + scale;
558-
precision = MIN(precision, NUMERIC_MAX_PRECISION);
559558
typmod = (((precision + 2) << 16) | scale) + VARHDRSZ;
560559
return numeric(num, typmod);
561560
}

0 commit comments

Comments
 (0)