Skip to content

Commit 64d9b50

Browse files
author
Thomas G. Lockhart
committed
Fix timezone manipulation code to avoid crashes on some machines.
Add type conversion functions for floating point numbers. Check for zero in unary minus floating point code (IEEE allows an explicit negative zero which looks ugly in a query result!). Ensure circle type has non-negative radius.
1 parent 9190a80 commit 64d9b50

File tree

6 files changed

+308
-201
lines changed

6 files changed

+308
-201
lines changed

src/backend/utils/adt/datetime.c

Lines changed: 3 additions & 2 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/datetime.c,v 1.4 1997/04/17 13:50:34 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.5 1997/05/11 15:11:31 thomas Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -558,7 +558,8 @@ abstime_date(AbsoluteTime abstime)
558558
#if FALSE
559559
GetCurrentTime(tm);
560560
#endif
561-
abstime = GetCurrentTransactionStartTime() + CTimeZone;
561+
abstime = GetCurrentTransactionStartTime();
562+
abstime2tm(abstime, &CTimeZone, tm);
562563
date->year = tm->tm_year;
563564
date->month = tm->tm_mon;
564565
date->day = tm->tm_mday;

0 commit comments

Comments
 (0)