1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Fix erroneous error reporting for overlength input in text_date(),

text_time(), and text_timetz().  7.4-vintage bug found by Greg Stark.
This commit is contained in:
Tom Lane
2007-06-02 16:41:15 +00:00
parent 4ad43de791
commit a6403435f0

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/date.c,v 1.125 2006/07/14 14:52:23 momjian Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/date.c,v 1.125.2.1 2007/06/02 16:41:15 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -863,8 +863,9 @@ text_date(PG_FUNCTION_ARGS)
ereport(ERROR,
(errcode(ERRCODE_INVALID_DATETIME_FORMAT),
errmsg("invalid input syntax for type date: \"%s\"",
VARDATA(str))));
DatumGetCString(DirectFunctionCall1(textout,
PointerGetDatum(str))))));
sp = VARDATA(str);
dp = dstr;
for (i = 0; i < (VARSIZE(str) - VARHDRSZ); i++)
@ -1590,7 +1591,8 @@ text_time(PG_FUNCTION_ARGS)
ereport(ERROR,
(errcode(ERRCODE_INVALID_DATETIME_FORMAT),
errmsg("invalid input syntax for type time: \"%s\"",
VARDATA(str))));
DatumGetCString(DirectFunctionCall1(textout,
PointerGetDatum(str))))));
sp = VARDATA(str);
dp = dstr;
@ -2359,7 +2361,8 @@ text_timetz(PG_FUNCTION_ARGS)
ereport(ERROR,
(errcode(ERRCODE_INVALID_DATETIME_FORMAT),
errmsg("invalid input syntax for type time with time zone: \"%s\"",
VARDATA(str))));
DatumGetCString(DirectFunctionCall1(textout,
PointerGetDatum(str))))));
sp = VARDATA(str);
dp = dstr;