提交 5f588805 编写于 作者: T Tom Lane

Ooops, no DATE_IS_NOBEGIN/DATE_IS_NOEND in 8.3 or 8.2 ...

I heard the siren call of git cherry-pick, but should have lashed myself
to the mast.
上级 dcb2b356
......@@ -403,20 +403,13 @@ date2timestamp_no_overflow(DateADT dateVal)
{
double result;
if (DATE_IS_NOBEGIN(dateVal))
result = -DBL_MAX;
else if (DATE_IS_NOEND(dateVal))
result = DBL_MAX;
else
{
#ifdef HAVE_INT64_TIMESTAMP
/* date is days since 2000, timestamp is microseconds since same... */
result = dateVal * (double) USECS_PER_DAY;
/* date is days since 2000, timestamp is microseconds since same... */
result = dateVal * (double) USECS_PER_DAY;
#else
/* date is days since 2000, timestamp is seconds since same... */
result = dateVal * (double) SECS_PER_DAY;
/* date is days since 2000, timestamp is seconds since same... */
result = dateVal * (double) SECS_PER_DAY;
#endif
}
return result;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册