mirror of
https://github.com/postgres/postgres.git
synced 2025-05-02 11:44:50 +03:00
Fixed error handling in Informix compat str to date conversion.
This commit is contained in:
parent
34e9ab027b
commit
3cda980298
@ -1675,6 +1675,10 @@ Mon Oct 6 08:41:45 CEST 2003
|
|||||||
- Fixed constant listing in execute using clause.
|
- Fixed constant listing in execute using clause.
|
||||||
- Fixed typo in ecpg for Informix dec_t type.
|
- Fixed typo in ecpg for Informix dec_t type.
|
||||||
- Fixed precision handling in Informix compat funxtions.
|
- Fixed precision handling in Informix compat funxtions.
|
||||||
|
|
||||||
|
Tue Oct 7 07:45:09 CEST 2003
|
||||||
|
|
||||||
|
- Fixed error handling in rstrdate.
|
||||||
- Set ecpg version to 3.0.0
|
- Set ecpg version to 3.0.0
|
||||||
- Set ecpg library to 4.0.0
|
- Set ecpg library to 4.0.0
|
||||||
- Set pgtypes library to 1.0.0
|
- Set pgtypes library to 1.0.0
|
||||||
|
@ -436,7 +436,7 @@ rstrdate(char *str, date * d)
|
|||||||
{
|
{
|
||||||
date dat = PGTYPESdate_from_asc(str, NULL);
|
date dat = PGTYPESdate_from_asc(str, NULL);
|
||||||
|
|
||||||
if (errno != PGTYPES_DATE_BAD_DATE && dat == 0)
|
if (errno && errno != PGTYPES_DATE_BAD_DATE)
|
||||||
return ECPG_INFORMIX_BAD_DATE;
|
return ECPG_INFORMIX_BAD_DATE;
|
||||||
|
|
||||||
*d = dat;
|
*d = dat;
|
||||||
|
@ -53,14 +53,14 @@ PGTYPESdate_from_asc(char *str, char **endptr)
|
|||||||
if (strlen(str) >= sizeof(lowstr))
|
if (strlen(str) >= sizeof(lowstr))
|
||||||
{
|
{
|
||||||
errno = PGTYPES_DATE_BAD_DATE;
|
errno = PGTYPES_DATE_BAD_DATE;
|
||||||
return 0;
|
return INT_MIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((ParseDateTime(str, lowstr, field, ftype, MAXDATEFIELDS, &nf, ptr) != 0)
|
if ((ParseDateTime(str, lowstr, field, ftype, MAXDATEFIELDS, &nf, ptr) != 0)
|
||||||
|| (DecodeDateTime(field, ftype, nf, &dtype, tm, &fsec, &tzp, EuroDates) != 0))
|
|| (DecodeDateTime(field, ftype, nf, &dtype, tm, &fsec, &tzp, EuroDates) != 0))
|
||||||
{
|
{
|
||||||
errno = PGTYPES_DATE_BAD_DATE;
|
errno = PGTYPES_DATE_BAD_DATE;
|
||||||
return 0;
|
return INT_MIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (dtype)
|
switch (dtype)
|
||||||
@ -74,7 +74,7 @@ PGTYPESdate_from_asc(char *str, char **endptr)
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
errno = PGTYPES_DATE_BAD_DATE;
|
errno = PGTYPES_DATE_BAD_DATE;
|
||||||
return -1;
|
return INT_MIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
dDate = (date2j(tm->tm_year, tm->tm_mon, tm->tm_mday) - date2j(2000, 1, 1));
|
dDate = (date2j(tm->tm_year, tm->tm_mon, tm->tm_mday) - date2j(2000, 1, 1));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user