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

Commit1e790e2

Browse files
author
Thomas G. Lockhart
committed
Fix return value for tm2datetime to properly indicate failure.
1 parentb6b4117 commit1e790e2

File tree

1 file changed

+5
-3
lines changed
  • src/backend/utils/adt

1 file changed

+5
-3
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.20 1997/05/11 15:11:34 thomas Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.21 1997/05/13 04:26:07 thomas Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -700,7 +700,9 @@ printf( "datetime_add_span- date was %d.%02d.%02d\n", tm->tm_year, tm->tm_mon, t
700700
#ifdefDATEDEBUG
701701
printf("datetime_add_span- date becomes %d.%02d.%02d\n",tm->tm_year,tm->tm_mon,tm->tm_mday);
702702
#endif
703-
tm2datetime(tm,fsec,NULL,result);
703+
if (tm2datetime(tm,fsec,NULL,result)!=0)
704+
elog(WARN,"Unable to add datetime and timespan",NULL);
705+
704706

705707
}else {
706708
DATETIME_INVALID(*result);
@@ -1673,7 +1675,7 @@ tm2datetime( struct tm *tm, double fsec, int *tzp, DateTime *result) {
16731675

16741676
/* Julian day routines are not correct for negative Julian days */
16751677
if (!IS_VALID_JULIAN(tm->tm_year,tm->tm_mon,tm->tm_mday))
1676-
return(DT_INVALID);
1678+
return(-1);
16771679

16781680
date=date2j(tm->tm_year,tm->tm_mon,tm->tm_mday)-date2j(2000,1,1);
16791681
time=time2t(tm->tm_hour,tm->tm_min,(tm->tm_sec+fsec));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp