Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit64dff0b

Browse files
committed
Fix some problems in new variable-resolution-timestamp code.
1 parentc456693 commit64dff0b

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-
returnDirectFunctionCall1(time_in,
924-
CStringGetDatum(dstr));
923+
returnDirectFunctionCall3(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-
returnDirectFunctionCall1(timetz_in,
1452-
CStringGetDatum(dstr));
1453+
returnDirectFunctionCall3(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
staticint32TimestampTypmod=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-
returnDirectFunctionCall1(timestamp_in,
1720-
CStringGetDatum(dstr));
1722+
returnDirectFunctionCall3(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-
returnDirectFunctionCall1(timestamptz_in,
1774-
CStringGetDatum(dstr));
1778+
returnDirectFunctionCall3(timestamptz_in,
1779+
CStringGetDatum(dstr),
1780+
ObjectIdGetDatum(InvalidOid),
1781+
Int32GetDatum(-1));
17751782
}
17761783

17771784

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp