Skip to content

Commit cc2ce83

Browse files
author
Thomas G. Lockhart
committed
Fix lookup tables used for rounding interval data values when not using
integer datetimes. Thanks to Tom Lane for spotting the problem.
1 parent 5c4e5aa commit cc2ce83

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/backend/utils/adt/timestamp.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v 1.66 2002/04/21 19:48:13 thomas Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v 1.67 2002/05/14 13:37:27 thomas Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -463,23 +463,23 @@ AdjustIntervalForTypmod(Interval *interval, int32 typmod)
463463
};
464464
#else
465465
static const double IntervalScales[MAX_INTERVAL_PRECISION+1] = {
466-
1000000,
467-
100000,
468-
10000,
469-
1000,
470-
100,
466+
1,
471467
10,
472-
1
468+
100,
469+
1000,
470+
10000,
471+
100000,
472+
1000000
473473
};
474474

475475
static const double IntervalOffsets[MAX_INTERVAL_PRECISION+1] = {
476-
-500000,
477-
-50000,
478-
-5000,
479-
-500,
480-
-50,
481-
-5,
482-
0
476+
0.5,
477+
0.05,
478+
0.005,
479+
0.0005,
480+
0.00005,
481+
0.000005,
482+
0.0000005
483483
};
484484
#endif
485485

0 commit comments

Comments
 (0)