aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2001-10-04 15:14:22 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2001-10-04 15:14:22 +0000
commit1392cbd0ed97f1bf956d4aa2cc4325f9a6418e8b (patch)
treee91b374e2571769414c027ecc83e11ac8a1f10a7 /src
parent04d975f0ca84438eb3095481b5153a7461c469bf (diff)
downloadpostgresql-1392cbd0ed97f1bf956d4aa2cc4325f9a6418e8b.tar.gz
postgresql-1392cbd0ed97f1bf956d4aa2cc4325f9a6418e8b.zip
AdjustTimeForTypmod has the same bug ...
Diffstat (limited to 'src')
-rw-r--r--src/backend/utils/adt/date.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/backend/utils/adt/date.c b/src/backend/utils/adt/date.c
index 762f6e0fbeb..f8693c753af 100644
--- a/src/backend/utils/adt/date.c
+++ b/src/backend/utils/adt/date.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.60 2001/10/04 14:49:57 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.61 2001/10/04 15:14:22 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -28,8 +28,7 @@
#include "utils/timestamp.h"
-static void
-AdjustTimeForTypmod(TimeADT *time, int32 typmod);
+static void AdjustTimeForTypmod(TimeADT *time, int32 typmod);
/*****************************************************************************
* Date ADT
@@ -502,7 +501,10 @@ AdjustTimeForTypmod(TimeADT *time, int32 typmod)
static int32 TimeTypmod = 0;
if (typmod != TimeTypmod)
- TimeScale = pow(10, typmod);
+ {
+ TimeScale = pow(10.0, typmod);
+ TimeTypmod = typmod;
+ }
*time = (rint(((double) *time)*TimeScale)/TimeScale);