mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-21 08:29:39 +08:00
date_recv should accept infinities.
Reported by James William Pye.
This commit is contained in:
parent
9529f4d532
commit
1a1ad6320c
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/date.c,v 1.150 2010/01/02 16:57:53 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/date.c,v 1.151 2010/02/18 04:31:16 itagaki Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -208,8 +208,10 @@ date_recv(PG_FUNCTION_ARGS)
|
||||
result = (DateADT) pq_getmsgint(buf, sizeof(DateADT));
|
||||
|
||||
/* Limit to the same range that date_in() accepts. */
|
||||
if (result < -POSTGRES_EPOCH_JDATE ||
|
||||
result >= JULIAN_MAX - POSTGRES_EPOCH_JDATE)
|
||||
if (DATE_NOT_FINITE(result))
|
||||
/* ok */ ;
|
||||
else if (result < -POSTGRES_EPOCH_JDATE ||
|
||||
result >= JULIAN_MAX - POSTGRES_EPOCH_JDATE)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
|
||||
errmsg("date out of range")));
|
||||
|
Loading…
Reference in New Issue
Block a user