From 5edfdc2a547e2d57752841294d270c3e03894e3b Mon Sep 17 00:00:00 2001 From: Federico Di Gregorio Date: Fri, 24 Jun 2005 07:11:44 +0000 Subject: [PATCH] INTERVAL overflow fix. --- ChangeLog | 5 +++++ NEWS | 2 ++ lib/extras.py | 6 +++--- lib/psycopg1.py | 6 +++--- psycopg/typecast_datetime.c | 4 ++-- setup.cfg | 4 ++-- 6 files changed, 17 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5c70491e..352f96f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-06-24 Federico Di Gregorio + + * psycopg/typecast_datetime.c (typecast_PYINTERVAL_cast): applied patch + from Geert Jansen to fix interval bug due to overflow. + 2005-06-18 Federico Di Gregorio * setup.cfg: some clarifications and include_dirs example for Mandrake. diff --git a/NEWS b/NEWS index def3e824..c29d9941 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,8 @@ What's new in psycopg 2.0 beta 4 * psycopg2.connect() now takes an integer for the port keyword parameter. +* Fixed lots of small bugs, see ChangeLog for details. + What's new in psycopg 2.0 beta 3 -------------------------------- diff --git a/lib/extras.py b/lib/extras.py index 55168b51..aae5e4f7 100644 --- a/lib/extras.py +++ b/lib/extras.py @@ -17,9 +17,9 @@ and classes untill a better place in the distribution is found. # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. -from psycopg.extensions import cursor as _cursor -from psycopg.extensions import register_adapter as _RA -from psycopg.extensions import adapt as _A +from psycopg2.extensions import cursor as _cursor +from psycopg2.extensions import register_adapter as _RA +from psycopg2.extensions import adapt as _A class DictCursor(_cursor): diff --git a/lib/psycopg1.py b/lib/psycopg1.py index 614418f3..d953b11e 100644 --- a/lib/psycopg1.py +++ b/lib/psycopg1.py @@ -21,10 +21,10 @@ old code hile porting to psycopg 2. Import as follows: # for more details. import _psycopg as _2psycopg -from psycopg.extensions import cursor as _2cursor -from psycopg.extensions import connection as _2connection +from psycopg2.extensions import cursor as _2cursor +from psycopg2.extensions import connection as _2connection -from psycopg import * +from psycopg2 import * del connect diff --git a/psycopg/typecast_datetime.c b/psycopg/typecast_datetime.c index 1a1bff48..7ce9fb49 100644 --- a/psycopg/typecast_datetime.c +++ b/psycopg/typecast_datetime.c @@ -162,9 +162,9 @@ typecast_PYTIME_cast(unsigned char *str, int len, PyObject *curs) static PyObject * typecast_PYINTERVAL_cast(unsigned char *str, int len, PyObject *curs) { - long years = 0, months = 0, days = 0, denominator = 1; + long years = 0, months = 0, days = 0; double hours = 0.0, minutes = 0.0, seconds = 0.0, hundredths = 0.0; - double v = 0.0, sign = 1.0; + double v = 0.0, sign = 1.0, denominator = 1.0; int part = 0, sec; double micro; diff --git a/setup.cfg b/setup.cfg index c6e7d787..b385d07f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -9,8 +9,8 @@ use_pydatetime=1 # include_dirs is the preferred method for locating postgresql headers, # but some extra checks on sys.platform will still be done in setup.py. # the next line is the default as used on psycopg author Debian system: -include_dirs=.:/usr/include/postgresql:/usr/include/postgresql/server -# uncomment next line on Mandrake 10.1 (and comment previous one): +include_dirs=.:/usr/include/postgresql/8.0:/usr/include/postgresql/8.0/server +# uncomment next line on Mandrake 10.x (and comment previous one): #include_dirs=.:/usr/include/pgsql:/usr/include/pgsql/server # if postgresql is installed somewhere weird (i.e., not in your runtime library