mirror of
https://github.com/postgres/postgres.git
synced 2025-05-29 16:21:20 +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:
parent
dc9b57fcc8
commit
27918376f0
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/utils/adt/date.c,v 1.122.2.1 2006/02/09 03:40:30 tgl Exp $
|
* $PostgreSQL: pgsql/src/backend/utils/adt/date.c,v 1.122.2.2 2007/06/02 16:41:23 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -864,7 +864,8 @@ text_date(PG_FUNCTION_ARGS)
|
|||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_INVALID_DATETIME_FORMAT),
|
(errcode(ERRCODE_INVALID_DATETIME_FORMAT),
|
||||||
errmsg("invalid input syntax for type date: \"%s\"",
|
errmsg("invalid input syntax for type date: \"%s\"",
|
||||||
VARDATA(str))));
|
DatumGetCString(DirectFunctionCall1(textout,
|
||||||
|
PointerGetDatum(str))))));
|
||||||
|
|
||||||
sp = VARDATA(str);
|
sp = VARDATA(str);
|
||||||
dp = dstr;
|
dp = dstr;
|
||||||
@ -1591,7 +1592,8 @@ text_time(PG_FUNCTION_ARGS)
|
|||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_INVALID_DATETIME_FORMAT),
|
(errcode(ERRCODE_INVALID_DATETIME_FORMAT),
|
||||||
errmsg("invalid input syntax for type time: \"%s\"",
|
errmsg("invalid input syntax for type time: \"%s\"",
|
||||||
VARDATA(str))));
|
DatumGetCString(DirectFunctionCall1(textout,
|
||||||
|
PointerGetDatum(str))))));
|
||||||
|
|
||||||
sp = VARDATA(str);
|
sp = VARDATA(str);
|
||||||
dp = dstr;
|
dp = dstr;
|
||||||
@ -2360,7 +2362,8 @@ text_timetz(PG_FUNCTION_ARGS)
|
|||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_INVALID_DATETIME_FORMAT),
|
(errcode(ERRCODE_INVALID_DATETIME_FORMAT),
|
||||||
errmsg("invalid input syntax for type time with time zone: \"%s\"",
|
errmsg("invalid input syntax for type time with time zone: \"%s\"",
|
||||||
VARDATA(str))));
|
DatumGetCString(DirectFunctionCall1(textout,
|
||||||
|
PointerGetDatum(str))))));
|
||||||
|
|
||||||
sp = VARDATA(str);
|
sp = VARDATA(str);
|
||||||
dp = dstr;
|
dp = dstr;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user