mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-01-31 09:24:07 +03:00
Fixed problem with year > 9999.
This commit is contained in:
parent
401af084ab
commit
d061b384d9
|
@ -1,3 +1,7 @@
|
||||||
|
2007-01-16 Federico Di Gregorio <fog@initd.org>
|
||||||
|
|
||||||
|
* psycopg/typecast_datetime.c: fixed problem with year > 9999.
|
||||||
|
|
||||||
2006-10-29 Federico Di Gregorio <fog@initd.org>
|
2006-10-29 Federico Di Gregorio <fog@initd.org>
|
||||||
|
|
||||||
* Applied patch from Jason Erickson to make psycopg build
|
* Applied patch from Jason Erickson to make psycopg build
|
||||||
|
|
|
@ -59,6 +59,7 @@ typecast_PYDATE_cast(char *str, int len, PyObject *curs)
|
||||||
PyErr_SetString(DataError, "unable to parse date");
|
PyErr_SetString(DataError, "unable to parse date");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
if (y > 9999) y = 9999;
|
||||||
obj = PyObject_CallFunction(pyDateTypeP, "iii", y, m, d);
|
obj = PyObject_CallFunction(pyDateTypeP, "iii", y, m, d);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -111,7 +112,9 @@ typecast_PYDATETIME_cast(char *str, int len, PyObject *curs)
|
||||||
mm += 1;
|
mm += 1;
|
||||||
ss -= 60;
|
ss -= 60;
|
||||||
}
|
}
|
||||||
|
if (y > 9999)
|
||||||
|
y = 9999;
|
||||||
|
|
||||||
if (n == 5 && ((cursorObject*)curs)->tzinfo_factory != Py_None) {
|
if (n == 5 && ((cursorObject*)curs)->tzinfo_factory != Py_None) {
|
||||||
/* we have a time zone, calculate minutes and create
|
/* we have a time zone, calculate minutes and create
|
||||||
appropriate tzinfo object calling the factory */
|
appropriate tzinfo object calling the factory */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user