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

Commit1c68f27

Browse files
committed
Correct bogus mktime() calls.
1 parentea283f1 commit1c68f27

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

‎src/backend/utils/adt/datetime.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.62 2001/03/22 03:59:50 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.63 2001/04/03 18:05:53 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -1120,6 +1120,8 @@ DecodeTimeOnly(char **field, int *ftype, int nf,
11201120
tmp->tm_sec=tm->tm_sec;
11211121

11221122
#if defined(HAVE_TM_ZONE)|| defined(HAVE_INT_TIMEZONE)
1123+
tmp->tm_year-=1900;
1124+
tmp->tm_mon-=1;
11231125
tmp->tm_isdst=-1;
11241126
mktime(tmp);
11251127
tm->tm_isdst=tmp->tm_isdst;

‎src/backend/utils/adt/timestamp.c

Lines changed: 1 addition & 3 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.46 2001/03/22 03:59:54 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v 1.47 2001/04/03 18:05:53 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -1085,7 +1085,6 @@ timestamp_pl_span(PG_FUNCTION_ARGS)
10851085
if (IS_VALID_UTIME(tm->tm_year,tm->tm_mon,tm->tm_mday))
10861086
{
10871087
#if defined(HAVE_TM_ZONE)|| defined(HAVE_INT_TIMEZONE)
1088-
tm->tm_isdst=-1;
10891088
tm->tm_year-=1900;
10901089
tm->tm_mon-=1;
10911090
tm->tm_isdst=-1;
@@ -1727,7 +1726,6 @@ timestamp_trunc(PG_FUNCTION_ARGS)
17271726
if (IS_VALID_UTIME(tm->tm_year,tm->tm_mon,tm->tm_mday))
17281727
{
17291728
#if defined(HAVE_TM_ZONE)|| defined(HAVE_INT_TIMEZONE)
1730-
tm->tm_isdst=-1;
17311729
tm->tm_year-=1900;
17321730
tm->tm_mon-=1;
17331731
tm->tm_isdst=-1;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp