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

Commit 64dff0b

Browse files
committed
Fix some problems in new variable-resolution-timestamp code.
1 parent c456693 commit 64dff0b

File tree

2 files changed

+22
-11
lines changed

2 files changed

+22
-11
lines changed

src/backend/utils/adt/date.c

Lines changed: 9 additions & 5 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/date.c,v 1.59 2001/10/03 05:29:24 thomas Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.60 2001/10/04 14:49:57 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -920,8 +920,10 @@ text_time(PG_FUNCTION_ARGS)
920920
*dp++ = *sp++;
921921
*dp = '\0';
922922

923-
return DirectFunctionCall1(time_in,
924-
CStringGetDatum(dstr));
923+
return DirectFunctionCall3(time_in,
924+
CStringGetDatum(dstr),
925+
ObjectIdGetDatum(InvalidOid),
926+
Int32GetDatum(-1));
925927
}
926928

927929

@@ -1448,8 +1450,10 @@ text_timetz(PG_FUNCTION_ARGS)
14481450
*dp++ = *sp++;
14491451
*dp = '\0';
14501452

1451-
return DirectFunctionCall1(timetz_in,
1452-
CStringGetDatum(dstr));
1453+
return DirectFunctionCall3(timetz_in,
1454+
CStringGetDatum(dstr),
1455+
ObjectIdGetDatum(InvalidOid),
1456+
Int32GetDatum(-1));
14531457
}
14541458

14551459
/* timetz_zone()

src/backend/utils/adt/timestamp.c

Lines changed: 13 additions & 6 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.53 2001/10/03 15:50:48 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v 1.54 2001/10/04 14:49:57 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -152,7 +152,10 @@ AdjustTimestampForTypmod(Timestamp *time, int32 typmod)
152152
static int32 TimestampTypmod = 0;
153153

154154
if (typmod != TimestampTypmod)
155-
TimestampScale = pow(10, typmod);
155+
{
156+
TimestampScale = pow(10.0, typmod);
157+
TimestampTypmod = typmod;
158+
}
156159

157160
*time = (rint(((double) *time)*TimestampScale)/TimestampScale);
158161
}
@@ -1716,8 +1719,10 @@ text_timestamp(PG_FUNCTION_ARGS)
17161719
*dp++ = *sp++;
17171720
*dp = '\0';
17181721

1719-
return DirectFunctionCall1(timestamp_in,
1720-
CStringGetDatum(dstr));
1722+
return DirectFunctionCall3(timestamp_in,
1723+
CStringGetDatum(dstr),
1724+
ObjectIdGetDatum(InvalidOid),
1725+
Int32GetDatum(-1));
17211726
}
17221727

17231728

@@ -1770,8 +1775,10 @@ text_timestamptz(PG_FUNCTION_ARGS)
17701775
*dp++ = *sp++;
17711776
*dp = '\0';
17721777

1773-
return DirectFunctionCall1(timestamptz_in,
1774-
CStringGetDatum(dstr));
1778+
return DirectFunctionCall3(timestamptz_in,
1779+
CStringGetDatum(dstr),
1780+
ObjectIdGetDatum(InvalidOid),
1781+
Int32GetDatum(-1));
17751782
}
17761783

17771784

0 commit comments

Comments
 (0)