mirror of
https://github.com/postgres/postgres.git
synced 2025-06-16 06:01:02 +03:00
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.
This commit is contained in:
@ -184,7 +184,8 @@ timestamp_datetime(time_t timestamp)
|
||||
tm->tm_year += 1900;
|
||||
tm->tm_mon += 1;
|
||||
|
||||
*result = tm2datetime(tm, fsec, NULL);
|
||||
if (tm2datetime(tm, fsec, NULL, result) != 0)
|
||||
elog(WARN,"Unable to convert timestamp to datetime",timestamp_out(timestamp));
|
||||
|
||||
return(result);
|
||||
} /* timestamp_datetime() */
|
||||
|
Reference in New Issue
Block a user