Update of /cvsroot/pypgsql/pypgsql/pyPgSQL
In directory sc8-pr-cvs1:/tmp/cvs-serv4291a/pyPgSQL
Modified Files:
PgSQL.py
Log Message:
05JUL2003 bga - Fixed a problem with PgNumeric where an exception can be
thrown if the stated scale and precision of the returned in
the first result row does not match later rows.
Index: PgSQL.py
===================================================================
RCS file: /cvsroot/pypgsql/pypgsql/pyPgSQL/PgSQL.py,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** PgSQL.py 27 Jun 2003 03:03:08 -0000 1.34
--- PgSQL.py 14 Jul 2003 21:19:20 -0000 1.35
***************
*** 30,33 ****
--- 30,37 ----
# Date Ini Description |
# --------- --- ------------------------------------------------------- |
+ # 05JUL2003 bga - Fixed a problem with PgNumeric where an exception can |
+ # be thrown if the stated scale and precision of the |
+ # returned in the first result row does not match later |
+ # rows. |
# 26JUN2003 bga - Applied patch from Laurent Pinchart to allow _quote |
# to correctly process objects that are sub-classed |
***************
*** 783,787 ****
# of the current field does not match the precision and
# scale of the first record in the result set (there are
! # a few reasons that this can happen). Let PgNumeric
# figure out a precision and scale from the value.
return PgNumeric(value)
--- 787,791 ----
# of the current field does not match the precision and
# scale of the first record in the result set (there are
! # a few reasons why this can happen). Let PgNumeric
# figure out a precision and scale from the value.
return PgNumeric(value)
***************
*** 839,843 ****
lst[_i] = PgInt8(lst[_i])
elif _ftv == PG_NUMERIC:
! lst[_i] = PgNumeric(lst[_i], _p, _s)
elif _ftv == PG_INT2:
lst[_i] = PgInt2(lst[_i])
--- 843,855 ----
lst[_i] = PgInt8(lst[_i])
elif _ftv == PG_NUMERIC:
! try:
! lst[_i] = PgNumeric(lst[_i], _p, _s)
! except OverflowError:
! # If we reached this point, then the precision and scale
! # of the current field does not match the precision and
! # scale of the first record in the result set (there are
! # a few reasons why this can happen). Let PgNumeric
! # figure out a precision and scale from the value.
! lst[_i] = PgNumeric(lst[_i])
elif _ftv == PG_INT2:
lst[_i] = PgInt2(lst[_i])
|