INTERVAL overflow fix.

This commit is contained in:
Federico Di Gregorio 2005-06-24 07:11:44 +00:00
parent 3f63c53fd0
commit 5edfdc2a54
6 changed files with 17 additions and 10 deletions

View File

@ -1,3 +1,8 @@
2005-06-24 Federico Di Gregorio <fog@initd.org>
* 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 <fog@initd.org>
* setup.cfg: some clarifications and include_dirs example for Mandrake.

2
NEWS
View File

@ -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
--------------------------------

View File

@ -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):

View File

@ -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

View File

@ -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;

View File

@ -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