You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(52) |
Oct
(21) |
Nov
(10) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(3) |
Feb
(7) |
Mar
|
Apr
(8) |
May
(1) |
Jun
(6) |
Jul
(4) |
Aug
(4) |
Sep
(18) |
Oct
(26) |
Nov
(7) |
Dec
(25) |
2003 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
(1) |
May
(1) |
Jun
(10) |
Jul
(10) |
Aug
|
Sep
|
Oct
(5) |
Nov
(2) |
Dec
(2) |
2004 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2005 |
Jan
|
Feb
(1) |
Mar
(8) |
Apr
(1) |
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(11) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
From: Gerhard H?r. <gha...@us...> - 2002-06-05 09:14:15
|
Update of /cvsroot/pypgsql/pypgsql In directory usw-pr-cvs1:/tmp/cvs-serv15030 Modified Files: setup.py Log Message: 05JUN2002 gh - Statically link to libpq on win32. Fixes bug #539819. Index: setup.py =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/setup.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** setup.py 5 Jun 2002 08:46:21 -0000 1.14 --- setup.py 5 Jun 2002 09:14:11 -0000 1.15 *************** *** 98,102 **** # You will probably have to change win_pg_build_root for your system. ! win_pg_build_root = "h:/src/pgsql/" include_dirs = [ win_pg_build_root + "src/include", --- 98,102 ---- # You will probably have to change win_pg_build_root for your system. ! win_pg_build_root = "h:/src/postgresql-7.2.1/" include_dirs = [ win_pg_build_root + "src/include", *************** *** 108,114 **** optional_libs = [ "wsock32", "advapi32" ] ! optional_libs += [ "pqdll" ] # [ "pq" ] for static linking ! data_files = [ "libpq.dll" ] # [] for static linking sources = sources + [ "windows/strtoll.c", --- 108,114 ---- optional_libs = [ "wsock32", "advapi32" ] ! optional_libs += [ "pq", "wsock32" ] ! data_files = [] sources = sources + [ "windows/strtoll.c", |
From: Gerhard H?r. <gha...@us...> - 2002-06-05 08:49:20
|
Update of /cvsroot/pypgsql/pypgsql In directory usw-pr-cvs1:/tmp/cvs-serv6145 Modified Files: Announce Log Message: 05JUN2002 gh Made announcement for version 2.1. Index: Announce =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/Announce,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Announce 5 Nov 2001 01:18:12 -0000 1.16 --- Announce 5 Jun 2002 08:49:17 -0000 1.17 *************** *** 1,27 **** ! Announce: pyPgSQL - Version 2.0 is released. =========================================================================== ! pyPgSQL v2.0 has been released. It is a bug fix release to version 1.6, ! but also include some enhancements. With this release, pyPgSQL is now a ! "real" package. This was done to facilitate the implementation of pickling ! of the supplied PostgreSQL support objects, PgBoolean, PgInt2, PgInt8, and ! PgLargeObject. ! ! NOTE: This change will require the used of "from pyPgSQL import PgSQL" and ! "from pyPgSQL import libpq" to import the PgSQL and libpq modules. It is available at http://pypgsql.sourceforge.net. pyPgSQL is a package of two (2) modules that provide a Python DB-API 2.0 ! compliant interface to PostgreSQL databases. The first module, libpq, ! exports the PostgreSQL C API to Python. This module is written in C and ! can be compiled into Python or can be dynamically loaded on demand. The second module, PgSQL, provides the DB-API 2.0 compliant interface and support for various PostgreSQL data types, such as INT8, NUMERIC, MONEY, ! BOOL, ARRAYS, etc. This module is written in Python and works with PostgreSQL 7.0 or later and Python 2.0 or later. Note: It is highly recommended that you use PostgreSQL 7.1 or later and ! Python 2.1 or later. PostgreSQL is a sophisticated Object-Relational DBMS, supporting almost all --- 1,21 ---- ! Announce: pyPgSQL - Version 2.1 is released. =========================================================================== ! pyPgSQL v2.1 has been released. It is a bug fix release to version 2.0, but ! also includes some enhancements. It is available at http://pypgsql.sourceforge.net. pyPgSQL is a package of two (2) modules that provide a Python DB-API 2.0 ! compliant interface to PostgreSQL databases. The first module, libpq, ! exports the PostgreSQL C API to Python. This module is written in C and ! can be compiled into Python or can be dynamically loaded on demand. The second module, PgSQL, provides the DB-API 2.0 compliant interface and support for various PostgreSQL data types, such as INT8, NUMERIC, MONEY, ! BOOL, ARRAYS, etc. This module is written in Python and works with PostgreSQL 7.0 or later and Python 2.0 or later. Note: It is highly recommended that you use PostgreSQL 7.1 or later and ! Python 2.1 or later. PostgreSQL is a sophisticated Object-Relational DBMS, supporting almost all *************** *** 32,43 **** Python is an interpreted, interactive, object-oriented programming lang- ! uage. It combines remarkable power with very clear syntax. It has mod- ules, classes, exceptions, very high level dynamic data types, and dynamic ! typing. There are interfaces to many system calls and libraries, as well ! as to various windowing systems (X11, Motif, Tk, Mac, MFC). New builtin ! modules are easily written in C or C++. Python is also usable as an exten- ! sion language for applications that need a programmable interface. Python is copyrighted but freely usable and distributable, even for commercial ! use. More information about Python can be found on the Python home page at http://www.python.org. --- 26,37 ---- Python is an interpreted, interactive, object-oriented programming lang- ! uage. It combines remarkable power with very clear syntax. It has mod- ules, classes, exceptions, very high level dynamic data types, and dynamic ! typing. There are interfaces to many system calls and libraries, as well ! as to various windowing systems (X11, Motif, Tk, Mac, MFC). New builtin ! modules are easily written in C or C++. Python is also usable as an exten- ! sion language for applications that need a programmable interface. Python is copyrighted but freely usable and distributable, even for commercial ! use. More information about Python can be found on the Python home page at http://www.python.org. *************** *** 46,184 **** =========================================================================== ! Changes since pyPgSQL Version 1.6 ================================= ! pyPgSQL is now a 'real' python package (i.e. there is a directory named ! pyPgSQL that contains a file named __init__.py). PgSQL and libpq are now ! modules contained in the pyPgSQL package. ! =-=-=-=-=-=-=-=-=-=-=-=-=- ** IMPORTANT NOTE ** =-=-=-=-=-=-=-=-=-=-=-=-=-= ! NOTE: This change requires the use of 'from pyPgSQL import PgSQL' to import ! the PgSQL module, and 'from pyPgSQL import libpq' to import the libpq ! module. ! -=-=-=-=-=-=-=-=-=-=-=-=-= ** IMPORTANT NOTE ** -=-=-=-=-=-=-=-=-=-=-=-=-=- Changes to PgSQL.py ------------------- ! * It appears that under certain circumstances, PostgreSQL will not ! return a precision/scale value for a numeric column when no result rows ! are returned [Bug #477792]. The problem is fixed by using a precision ! and scale of (30,6) when this condition occurs. ! ! * Change the import of DateTime to avoid conflicts with ZOPE's builtin ! DateTime module. ! * Added code to ensure that creation of a binary object via the binary() ! method always occurs within the context of a transaction. ! * Change code so that the escaping/quoting is different if the result is ! to be used to build PostgreSQL arrays. ! * Modified all the Object._quote methods so that they now accept an ! option argument, forArray, which if set to 1 will cause escaping / ! quoting for PostgreSQL array use. ! * Re-organized the code use to build PostgreSQL arrays. ! ! * Added additional PostgreSQL types to BINARY, ROWID, etc. ! * Fixed problems associated with type casting. Changes to libpqmodule.c ------------------------ ! * Added support for the pickling of libpq objects. In particular, for ! PgVersion and PgConnection objects. ! ! * Added a cntructor method for PgVersion objects. ! ! * Changed all new style comments to original style. ! ! * Change PgQuoteString and PgQuoteByta so that unsigned char pointers are ! used instead of signed char pointers. ! ! * Added different quoting/escaping if the result is to be used as part of ! a PostgreSQL array. ! ! * Change the quoting/escaping helper routines so that they also escape ! the double quote character. ! ! * Added a PgLargeObject constructor. ! ! Changes to pgboolean.c ! ---------------------- ! * Change the constructors so that they return PyObject * instead of ! PgBooleanObject *. ! ! Changes to pgconnection.c ! ------------------------- ! * Fixed a possible memory leak. ! ! * Added the lo_export() method. It was overlooked in the original code. ! ! * Added support for the pickling of PgConnection objects. In particular, ! a hidden method was added to return the connection information string ! used to create the connection. ! ! * Changed all new style comments to original style. ! ! * Added some brakets to clarify ambiguous else clauses. ! ! * Fixed numerous bugs found during the development of the regression test ! cases for pgconnection.c. ! ! * The PgConnection's attributes are now set to a value of None when ! finish() is called. ! ! Changes to pgint2object.c ! ------------------------- ! * Changed all new style comments to original style. ! ! * Change the constructors so that they return PyObject * instead of ! PgInt2Object *. ! ! Changes to pgint8object.c ! ------------------------- ! * Changed all new style comments to original style. ! ! * Change the constructors so that they return PyObject * instead of ! PgInt8Object *. ! ! Changes to pglargeobject.c ! -------------------------- ! * Closed some memory leaks. This leaks had only a small probability of ! occuring. ! ! * Added support for the pickling of large objects. In particular, a ! method was added to retrieve the info needed to recreate the large ! object. Also, the open() and close() methods were changed to create ! and end transaction in the un-pickled large objects in order to create ! the context in which large object must be used. ! ! * Added a _quote() funtion. ! * Ensure that INV_BIN is not in the mode variable when lo_open is ! called. ! * Removed static declaration from validmodes[]. It's now used by ! lo_create in pgconnection.c also. Changes to pgresult.c --------------------- ! * [Bug #474771] Found and plugged a memory leak in the PgResult_New() ! function. An object for the value of PGcmdStatus was being created ! twice, leaving an extra copy around to consume memory. ! ! * Added support for the pickling of pyPgSQL objects. ! ! * Change error message returned by PgResult_ntuple_check if no tuples ! were returned in the result. The returned error message now makes ! sense. ! ! * Added support for the PostgreSQL BYTEA type. ! ! * I have removed resultErrorMessage as an attribute. It doesn't make ! sense to leave it since it will always be None. Why? Because any ! query that generates an error will raise an exception, not return a ! PgResult. ! --- 40,107 ---- =========================================================================== ! Changes since pyPgSQL Version 2.0 ================================= ! pyPgSQL 2.1 is now compatible and tested to work with PostgreSQL 7.2.x. ! Changes to README ! ----------------- ! * Added documentation for the new TransactionLevel attribute of ! the Connection object. Changes to PgSQL.py ------------------- + * Added code to implement support for setting PostgreSQL transaction + levels. [Feature Request #481727]. ! * Got rid of redundant building and storing of the ! mapping of column names to column positions in the PgResultSet class. Now, ! rows of the same query are instances of a dynamically created class, which ! has this mapping as a class attribute instead of an attribute of the ! instance. This saves a lot of space, and also slightly increases ! performance of cursor fetches. ! ! * Fixed the array parsing so it also works with PostgreSQL versions 7.2.x. ! The PostgreSQL developers changed the quoting in the string representation ! of arrays in 7.2 beta cycle: strings are now only quoted when otherwise ! the array representation would be ambiguous. The new parseArray() method ! should handle the old and new way of quoting in arrays. [Bug #539769]. ! Also added a new testcase for the ARRAY type. ! * Improved the array parsing, so that it now passes all ! the new mean testcases. Added support for parsing multidimensional arrays. ! Eventually, the array parsing code should go as a support function into ! libpq. ! * Replaced all typechecks with "is" operators instead ! of equals. Mark McEahern had a problem with using pyPgSQL in combination ! with a FixedPoint class where the reason was that the FixedPoint class was ! not comarable to None. The consensus on python-list was that None and all ! types are singletons, so they should be checked using "is", which is also ! faster, because it only checks for object identity. ! * Fixed a couple of problems found by Steven D. Arnold: ! 1. A undefined variable was used in a few places where notices were popped ! from the notice list. ! 2. Comparisons between 2 PgNumerics gave the wrong result. ! * Fixed problem that occurs when the sum() aggregate returns a ! NULL. [Bug #505162]. ! Changes to pgversion.c ! ---------------------- ! * Allow for development and beta versions of PostgreSQL Changes to libpqmodule.c ------------------------ ! * Removed special escaping of control characters in arrays. ! * Added support for two missing OID types: aclitem and macaddr. ! * Applied patch by Chris Bainbridge [Patch #505941] "fix for null bytes in ! bytea". Changes to pgresult.c --------------------- ! * Change the point at which an OID is tested to see if it is a ! Large Object from 1700 to 16383. |
From: Gerhard H?r. <gha...@us...> - 2002-06-05 08:46:23
|
Update of /cvsroot/pypgsql/pypgsql In directory usw-pr-cvs1:/tmp/cvs-serv5367 Modified Files: setup.py Log Message: 05JUN2002 gh Increased version number to 2.1. Index: setup.py =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/setup.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** setup.py 4 Nov 2001 05:56:21 -0000 1.13 --- setup.py 5 Jun 2002 08:46:21 -0000 1.14 *************** *** 12,16 **** # | # Description: Setup script (using the distutils framework) for | ! # pyPgsql Version 2.0. | # | # Note: This script requires the distutils package (standard in | --- 12,16 ---- # | # Description: Setup script (using the distutils framework) for | ! # pyPgsql Version 2.1. | # | # Note: This script requires the distutils package (standard in | *************** *** 69,73 **** from distutils.extension import Extension ! __version__ = "2.0" # Define the runtime library path for this module. It starts out as None. --- 69,73 ---- from distutils.extension import Extension ! __version__ = "2.1" # Define the runtime library path for this module. It starts out as None. |
From: Gerhard H?r. <gha...@us...> - 2002-06-05 08:43:39
|
Update of /cvsroot/pypgsql/pypgsql In directory usw-pr-cvs1:/tmp/cvs-serv4795 Modified Files: README Log Message: 05JUN2002 gh - Increased version number to 2.1. Index: README =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/README,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** README 5 Jun 2002 08:42:19 -0000 1.23 --- README 5 Jun 2002 08:43:36 -0000 1.24 *************** *** 1,4 **** #ident "@(#) $Id$" ! pyPgSQL - v2.0: Python DB-API 2.0 Compliant Interface Module for PostgreSQL. =========================================================================== --- 1,4 ---- #ident "@(#) $Id$" ! pyPgSQL - v2.1: Python DB-API 2.0 Compliant Interface Module for PostgreSQL. =========================================================================== |
From: Gerhard H?r. <gha...@us...> - 2002-06-05 08:42:24
|
Update of /cvsroot/pypgsql/pypgsql In directory usw-pr-cvs1:/tmp/cvs-serv4513 Modified Files: README Log Message: Undoing the commit with the empty log message. Index: README =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/README,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** README 5 Jun 2002 08:27:06 -0000 1.22 --- README 5 Jun 2002 08:42:19 -0000 1.23 *************** *** 1,4 **** #ident "@(#) $Id$" ! pyPgSQL - v2.1: Python DB-API 2.0 Compliant Interface Module for PostgreSQL. =========================================================================== --- 1,4 ---- #ident "@(#) $Id$" ! pyPgSQL - v2.0: Python DB-API 2.0 Compliant Interface Module for PostgreSQL. =========================================================================== |
From: Gerhard H?r. <gha...@us...> - 2002-05-15 16:24:21
|
Update of /cvsroot/pypgsql/pypgsql/pyPgSQL In directory usw-pr-cvs1:/tmp/cvs-serv12703/pyPgSQL Modified Files: PgSQL.py Log Message: 15MAY2002 gh Got rid of redundant building and storing of the mapping of column names to column positions in the PgResultSet class. Now, rows of the same query are instances of a dynamically created class, which has this mapping as a class attribute instead of an attri- bute of the instance. This saves a lot of space, and also slightly increases performance of cursor fetches. Index: PgSQL.py =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/pyPgSQL/PgSQL.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PgSQL.py 21 Apr 2002 21:01:48 -0000 1.9 --- PgSQL.py 15 May 2002 16:24:18 -0000 1.10 *************** *** 30,33 **** --- 30,40 ---- # Date Ini Description | # --------- --- ------------------------------------------------------- | + # 15MAY2002 gh Got rid of redundant building and storing of the | + # mapping of column names to column positions in the | + # PgResultSet class. Now, rows of the same query are | + # instances of a dynamically created class, which has | + # this mapping as a class attribute instead of an attri- | + # bute of the instance. This saves a lot of space, and | + # also slightly increases performance of cursor fetches. | # 21APR2002 gh Improved the array parsing, so that it now passes all | # the new mean testcases. Added support for parsing | *************** *** 309,312 **** --- 316,320 ---- import string import re + import new try: *************** *** 1410,1413 **** --- 1418,1422 ---- return 'NULL' + #-----------------------------------------------------------------------+ # Name: PgResultSet | *************** *** 1417,1440 **** # feature of being able to reference an attribute by | # column name in addition to a zero-based numeric index. | #-----------------------------------------------------------------------+ class PgResultSet: ! def __init__(self, value, description, mapname=None): self.__dict__['baseObj'] = value - self.__dict__['_desc_'] = description - - # Now we set up attributes based on the column names in the result set - self.__dict__['_xlatkey'] = {} - if mapname is None: - for _i in range(len(description)): - self.__dict__['_xlatkey'][description[_i][0]] = _i - else: - self.__dict__['_xlatkey'].update(mapname) - return def __getattr__(self, key): ! if self._xlatkey.has_key(key): ! return self.baseObj[self._xlatkey[key]] raise AttributeError, key --- 1426,1452 ---- # feature of being able to reference an attribute by | # column name in addition to a zero-based numeric index. | + # | + # This class isn't used directly, instead it's used as a | + # base class for the actual result set class created with | + # make_PgResultSetClass. | + # | #-----------------------------------------------------------------------+ class PgResultSet: ! # It may not be obvious what self.__class__ does: ! # Apart from the __init__ method, all methods are called on instances of a ! # class dynamically created make_PgResultSetClass, which means that when ! # you call a method, self.__class__ is *not* PgResultSet, but a subclass of ! # it created with make_PgResultSetClass (using the new module). The ! # subclass will have a class attribute called _xlatkey, which is a mapping ! # of column names to column positions. ! ! def __init__(self, value): self.__dict__['baseObj'] = value def __getattr__(self, key): ! if self.__class__._xlatkey.has_key(key): ! return self.baseObj[self.__class__._xlatkey[key]] raise AttributeError, key *************** *** 1445,1450 **** raise AttributeError, "%s is read-only." % key ! if self._xlatkey.has_key(key): ! self.__dict__['baseObj'][self._xlatkey(key)] = value else: raise AttributeError, key --- 1457,1462 ---- raise AttributeError, "%s is read-only." % key ! if self.__class__._xlatkey.has_key(key): ! self.__dict__['baseObj'][self.__class__._xlatkey(key)] = value else: raise AttributeError, key *************** *** 1455,1495 **** def __getitem__(self, key): if type(key) is StringType: ! key = self._xlatkey[key] return self.baseObj[key] def __setitem__(self, key, value): if type(key) is StringType: ! key = self._xlatkey[key] self.baseObj[key] = value return def __getslice__(self, i, j): ! return PgResultSet(self.baseObj[i:j], self._desc_[i:j]) ! ! def __setslice__(self, i, j, value): ! # If we are passed a PgResultSet object, convert it to the base ! # sequence object for the result set. Also update the description from ! # the PgResultSet. ! if i < 0: ! i = len(self.baseObj) + i ! if j < 0: ! j = len(self.baseObj) + j ! elif j > len(self.baseObj): ! j = len(self.baseObj) ! if isinstance(value, PgResultSet): ! self.__dict__['_desc_'][i:j] = value._desc_ ! self.__dict__['_xlatkey'] = {} ! for _i in range(len(self._desc_)): ! self.__dict__['_xlatkey'][self._desc_[_i][0]] = _i ! value = value.baseObj ! else: ! try: ! if len(value) != (j - i): ! raise ValueError, 'slice size mis-match' ! except: ! raise TypeError, 'illegal argument type for built-in operation' ! ! self.baseObj[i:j] = value ! return def __repr__(self): --- 1467,1483 ---- def __getitem__(self, key): if type(key) is StringType: ! key = self.__class__._xlatkey[key] return self.baseObj[key] def __setitem__(self, key, value): if type(key) is StringType: ! key = self.__class__._xlatkey[key] self.baseObj[key] = value return def __getslice__(self, i, j): ! klass = make_PgResultSetClass(self.__class__._desc_[i:j]) ! obj = klass(self.baseObj[i:j]) ! return obj def __repr__(self): *************** *** 1521,1529 **** def has_key(self, key): ! return self._xlatkey.has_key(key) def get(self, key): return self[key] #-----------------------------------------------------------------------+ # Define the PgSQL function calls: | --- 1509,1531 ---- def has_key(self, key): ! return self.__class__._xlatkey.has_key(key) def get(self, key): return self[key] + def make_PgResultSetClass(description, mapname=None): + """Dynamically create a new subclass of PgResultSet.""" + klass = new.classobj("PgResultSetConcreteClass", (PgResultSet,), {}) + klass.__dict__['_desc_'] = description + + klass.__dict__['_xlatkey'] = {} + if mapname is None: + for _i in range(len(description)): + klass.__dict__['_xlatkey'][description[_i][0]] = _i + else: + klass.__dict__['_xlatkey'].update(mapname) + return klass + + #-----------------------------------------------------------------------+ # Define the PgSQL function calls: | *************** *** 2025,2028 **** --- 2027,2032 ---- raise Warning, self.conn.notices.pop() self.conn.__dict__["inTransaction"] = 1 + self.__dict__["PgResultSetClass"] = None + def __del__(self): *************** *** 2085,2091 **** self.__dict__['rowcount'] = 1 - # Return a new PgResultSet. Note that we pass a copy of the descrip- - # tion to PgResultSet. - if fetchReturnsList: # Return a list (This is the minimum required by DB-API 2.0 --- 2089,2092 ---- *************** *** 2093,2099 **** return _j else: ! # Return a new PgResultSet. Note that we pass a copy of the ! # description to PgResultSet. ! return PgResultSet(_j, self.description[:], self._mapname) def __fetchManyRows(self, count, iList=[]): --- 2094,2098 ---- return _j else: ! return self.PgResultSetClass(_j) def __fetchManyRows(self, count, iList=[]): *************** *** 2198,2201 **** --- 2197,2204 ---- # Add the fieldname:fieldindex to the _mapname dictionary self._mapname[_j[0]] = _i + + # Create a subclass of PgResultSet. Note that we pass a copy of the + # description to this class. + self.PgResultSetClass = make_PgResultSetClass(self.description[:], self._mapname) def callproc(self, proc, *args): |
From: Gerhard H?r. <gha...@us...> - 2002-04-21 21:05:46
|
Update of /cvsroot/pypgsql/pypgsql/test/regression In directory usw-pr-cvs1:/tmp/cvs-serv22372/test/regression Modified Files: array.py Log Message: 21APR2002 gh Added some more mean testcases, which test for control characters and other special characters inside strings, and multi-dimensional arrays. Index: array.py =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/test/regression/array.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** array.py 17 Apr 2002 00:18:22 -0000 1.1 --- array.py 21 Apr 2002 21:05:43 -0000 1.2 *************** *** 35,38 **** --- 35,41 ---- # Date Ini Description | # --------- --- ------------------------------------------------------- | + # 21APR2002 gh Added some more mean testcases, which test for control | + # characters and other special characters inside strings, | + # and multi-dimensional arrays. | # 16APR2002 gh Initial release by Gerhard Häring. | #-----------------------------------------------------------------------+ *************** *** 44,47 **** --- 47,51 ---- def setUp(self): self.conn = PgSQL.connect(database="pypgsql") + self.conn.autocommit = 1 def checkEqual(self, real, planned): *************** *** 52,55 **** --- 56,63 ---- ivalues = [3,4,5] cursor = self.conn.cursor() + try: + cursor.execute("drop table test") + except: + pass cursor.execute("create table test (ia int[])") cursor.execute("insert into test(ia) values (%s)", (ivalues,)) *************** *** 59,63 **** "the integer array isn't returned as a list") self.checkEqual(result.ia, ivalues) - self.conn.rollback() def CheckForNumericInsert(self): --- 67,70 ---- *************** *** 65,68 **** --- 72,79 ---- cursor = self.conn.cursor() + try: + cursor.execute("drop table test") + except: + pass cursor.execute("create table test(na numeric[])") cursor.execute("insert into test(na) values (%s)", (numlist,)) *************** *** 72,79 **** "the numeric array isn't returned as a list") self.checkEqual(result.na, numlist) - self.conn.rollback() def CheckForStringInsert(self): - #self.conn.conn.toggleShowQuery cursor = self.conn.cursor() --- 83,88 ---- *************** *** 88,92 **** for stringlist in stringlists: ! cursor.execute("create table test(va varchar[])") cursor.execute("insert into test(va) values (%s)", (stringlist,)) cursor.execute("select va from test") --- 97,105 ---- for stringlist in stringlists: ! try: ! cursor.execute("drop table test") ! except: ! pass ! cursor.execute("create table test(va varchar[])") cursor.execute("insert into test(va) values (%s)", (stringlist,)) cursor.execute("select va from test") *************** *** 95,99 **** "the varchar array isn't returned as a list") self.checkEqual(result.va, stringlist) ! self.conn.rollback() if __name__ == "__main__": --- 108,183 ---- "the varchar array isn't returned as a list") self.checkEqual(result.va, stringlist) ! ! def CheckForStringInsertBruteForce(self): ! cursor = self.conn.cursor() ! ! chars = "\"'{}\\\n%s%sabc" % (chr(14), chr(5)) ! ! try: ! cursor.execute("drop table test") ! except: ! pass ! cursor.execute("create table test(va varchar[])") ! self.conn.commit() ! for i in chars: ! for j in chars: ! for k in chars: ! cursor.execute("insert into test(va) values (%s)", ([i+j+k],)) ! cursor.execute("select va from test where oid=%s", cursor.oidValue) ! result = cursor.fetchone() ! self.failUnlessEqual(type(result.va), types.ListType, \ ! "the varchar array isn't returned as a list") ! self.checkEqual(result.va, [i+j+k]) ! ! def CheckForStringInsertMultiDim(self): ! cursor = self.conn.cursor() ! ! stringlists = [[["a", "b"], ["c", "d"]], ! [[["a", "b"], ["c", "d"]], [["e", None], ["g", "h"]]], ! [[["{}", "\005{}\\'"], ["'asf'", "[\\{]"]], [["e", "f"], ["g", "h"]]], ! [["a", "b"], ["c", "d"]]] ! ! for stringlist in stringlists: ! try: ! cursor.execute("drop table test") ! except: ! pass ! cursor.execute("create table test(va varchar[])") ! cursor.execute("insert into test(va) values (%s)", (stringlist,)) ! cursor.execute("select va from test") ! result = cursor.fetchone() ! self.failUnlessEqual(type(result.va), types.ListType, \ ! "the varchar array isn't returned as a list") ! ! expected = stringlist[:] ! try: ! if expected[1][0][1] is None: ! expected[1][0][1] = '' ! except IndexError, reason: ! pass ! ! self.checkEqual(result.va, expected) ! ! def CheckForIntInsertMultiDim(self): ! cursor = self.conn.cursor() ! ! intlists = [[[1,2], [3,4]], ! [[-5,3,4], [2, None, 10]]] ! ! excpected_intlists = [[[1,2], [3,4]], ! [[-5,3,4], [2, 0, 10]]] ! ! for intlist, expected in zip(intlists, excpected_intlists): ! try: ! cursor.execute("drop table test") ! except: ! pass ! cursor.execute("create table test(ia int[])") ! cursor.execute("insert into test(ia) values (%s)", (intlist,)) ! cursor.execute("select ia from test") ! result = cursor.fetchone() ! self.failUnlessEqual(type(result.ia), types.ListType, \ ! "the int array isn't returned as a list") ! self.checkEqual(result.ia, expected) if __name__ == "__main__": *************** *** 103,106 **** --- 187,193 ---- TestSuite.addTest(ArrayTestCases("CheckForNumericInsert")) TestSuite.addTest(ArrayTestCases("CheckForStringInsert")) + #TestSuite.addTest(ArrayTestCases("CheckForStringInsertBruteForce")) + TestSuite.addTest(ArrayTestCases("CheckForStringInsertMultiDim")) + TestSuite.addTest(ArrayTestCases("CheckForIntInsertMultiDim")) runner = unittest.TextTestRunner() |
From: Gerhard H?r. <gha...@us...> - 2002-04-21 21:01:50
|
Update of /cvsroot/pypgsql/pypgsql/pyPgSQL In directory usw-pr-cvs1:/tmp/cvs-serv20866/pyPgSQL Modified Files: PgSQL.py Log Message: 21APR2002 gh Improved the array parsing, so that it now passes all the new mean testcases. Added support for parsing multidimensional arrays. Eventually, the array parsing code should go as a support function into libpq. --- Replaced all typechecks with "is" operators instead of equals. Mark McEahern had a problem with using pyPgSQL in combination with a FixedPoint class where the reason was that the FixedPoint class was not com- parable to None. The consensus on python-list was that None and all types are singletons, so they should be checked using "is", which is also faster, because it only checks for object identity. Index: PgSQL.py =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/pyPgSQL/PgSQL.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PgSQL.py 16 Apr 2002 00:14:01 -0000 1.8 --- PgSQL.py 21 Apr 2002 21:01:48 -0000 1.9 *************** *** 30,33 **** --- 30,45 ---- # Date Ini Description | # --------- --- ------------------------------------------------------- | + # 21APR2002 gh Improved the array parsing, so that it now passes all | + # the new mean testcases. Added support for parsing | + # multidimensional arrays. Eventually, the array parsing | + # code should go as a support function into libpq. | + # --- Replaced all typechecks with "is" operators instead | + # of equals. Mark McEahern had a problem with using | + # pyPgSQL in combination with a FixedPoint class where | + # the reason was that the FixedPoint class was not com- | + # parable to None. The consensus on python-list was that | + # None and all types are singletons, so they should be | + # checked using "is", which is also faster, because it | + # only checks for object identity. | # 16APR2002 gh Fix the array parsing so it also works with PostgreSQL | # versions 7.2.x. The PostgreSQL developers changed the | *************** *** 261,265 **** or affected (for DML statement). ! cursor.oidValue The object ID of the inserted record, if the last SQL command was an INSERT, otherwise it returns 0 (aka. InvalidOid) --- 273,277 ---- or affected (for DML statement). ! cursor.oidValue The object ID of the inserted record, if the last SQL command was an INSERT, otherwise it returns 0 (aka. InvalidOid) *************** *** 482,486 **** """ class LeaveLoopException(Exception): pass ! lst = [] s = s[1:-1] # drop '{' and '}' at start/end --- 494,498 ---- """ class LeaveLoopException(Exception): pass ! lst = [] s = s[1:-1] # drop '{' and '}' at start/end *************** *** 496,505 **** # A quoted element, find the end-quote, which is the next # quote char that is not escaped. ! end_quote_pos = pos while 1: ! end_quote_pos = s.find('"', end_quote_pos + 1) ! assert(end_quote_pos > pos) ! if s[end_quote_pos - 1] != '\\': ! break lst.append(s[pos + 1:end_quote_pos]) --- 508,523 ---- # A quoted element, find the end-quote, which is the next # quote char that is not escaped. ! end_quote_pos = pos + 1 ! escape = 0 while 1: ! if s[end_quote_pos] == '\\': ! escape = not escape ! elif s[end_quote_pos] == '"': ! if not escape: ! break ! escape = 0 ! else: ! escape = 0 ! end_quote_pos += 1 lst.append(s[pos + 1:end_quote_pos]) *************** *** 513,535 **** # This array element is not quoted, so it ends either at # the next comma that isn't escaped, or at the end of the ! # string. ! next_comma_pos = pos ! while 1: ! next_comma_pos = s.find(',', next_comma_pos + 1) ! if next_comma_pos < 0: ! # This is the last array element. ! lst.append(s[pos:]) ! raise LeaveLoopException else: ! if s[next_comma_pos - 1] != '\\': ! break ! lst.append(s[pos:next_comma_pos]) ! pos = next_comma_pos + 1 except LeaveLoopException: pass ! # Get rid of the array's backslash escaping level def convertEscapes(s): ! return s.replace('\\"', '"') lst = map(convertEscapes, lst) return lst --- 531,639 ---- # This array element is not quoted, so it ends either at # the next comma that isn't escaped, or at the end of the ! # string, or, if it contains a subarray, at the position ! # of the corresponding curly brace. ! if s[pos] != '{': ! next_comma_pos = pos + 1 ! escape = 0 ! while 1: ! if next_comma_pos >= len(s): ! # This is the last array element. ! lst.append(s[pos:]) ! raise LeaveLoopException ! ! if s[next_comma_pos] == '\\': ! escape = not escape ! elif s[next_comma_pos] == ',': ! if not escape: ! break ! escape = 0 ! else: ! escape = 0 ! next_comma_pos += 1 ! ! curelem = s[pos:next_comma_pos] ! if curelem.startswith("{"): ! lst.append(self.parseArray(curelem[1:-1])) else: ! lst.append(curelem) ! pos = next_comma_pos + 1 ! if s[pos] == ',': ! pos += 1 ! else: ! # The current character is '{', which means we've ! # found a sub-array: ! # We find the end of the sub-array, then feed this ! # string into parseArray again. ! escape = 0 ! open_braces = 1 ! closing_brace_pos = pos + 1 ! in_quotes = 0 ! while 1: ! if s[closing_brace_pos] == '\\': ! escape = not escape ! elif s[closing_brace_pos] == '{': ! if (not escape) and (not in_quotes): ! open_braces += 1 ! escape = 0 ! elif s[closing_brace_pos] == '}': ! if (not escape) and (not in_quotes): ! open_braces -= 1 ! if open_braces == 0: ! break ! escape = 0 ! elif s[closing_brace_pos] == '"': ! if not escape: ! in_quotes = not in_quotes ! escape = 0 ! else: ! escape = 0 ! closing_brace_pos += 1 ! ! curelem = s[pos:closing_brace_pos + 1] ! lst.append(self.parseArray(curelem)) ! pos = closing_brace_pos + 1 ! if pos >= len(s): ! break ! if s[pos] == ',': ! pos += 1 ! except LeaveLoopException: pass ! # Get rid of the escaping in the array string def convertEscapes(s): ! # If we're called with a list in a multi-dimensional ! # array, simply return the list. We only convert the ! # elements of the multi-dimensional array. ! if type(s) is ListType: ! return s ! ! schars = [] ! escape = 0 ! octdigits = [] ! ! for char in s: ! if char == '\\': ! escape += 1 ! if escape == 2: ! schars.append(char) ! escape = 0 ! else: ! if escape: ! if char in string.digits: ! octdigits.append(char) ! else: ! if octdigits != []: ! curchar = chr(int(octdigits[0]) * 64) + \ ! chr(int(octdigits[1]) * 8) + \ ! chr(int(octdigits[2])) ! schars.append(curchar) ! octdigits = [] ! schars.append(char) ! else: ! schars.append(char) ! escape = 0 ! return "".join(schars) ! lst = map(convertEscapes, lst) return lst *************** *** 541,545 **** object.""" ! if value == None: return value --- 645,649 ---- object.""" ! if value is None: return value *************** *** 554,572 **** if _ftv == PG_INT2: ! if type(value) == PgInt2Type: return value else: return PgInt2(value) elif _ftv == PG_INT4 or _ftv == ROWID: ! if type(value) == IntType: return value else: return int(value) elif _ftv == PG_INT8: ! if type(PgInt8) == ClassType: if isinstance(value, PgInt8): return value else: ! if type(value) == PgInt8Type: return value return PgInt8(value) --- 658,676 ---- if _ftv == PG_INT2: ! if type(value) is PgInt2Type: return value else: return PgInt2(value) elif _ftv == PG_INT4 or _ftv == ROWID: ! if type(value) is IntType: return value else: return int(value) elif _ftv == PG_INT8: ! if type(PgInt8) is ClassType: if isinstance(value, PgInt8): return value else: ! if type(value) is PgInt8Type: return value return PgInt8(value) *************** *** 582,593 **** return PgMoney(value) elif _ftv == DATETIME: ! if type(value) in [ DateTimeType, DateTimeDeltaType ]: return value else: return DateTime.ISO.ParseAny(value) elif _ftv == BINARY: ! if isinstance(value, PgBytea) or type(value) == PgLargeObjectType: return value ! elif type(value) == IntType: return PgLargeObject(self.conn, value) else: --- 686,697 ---- return PgMoney(value) elif _ftv == DATETIME: ! if type(value) in [DateTimeType, DateTimeDeltaType]: return value else: return DateTime.ISO.ParseAny(value) elif _ftv == BINARY: ! if isinstance(value, PgBytea) or type(value) is PgLargeObjectType: return value ! elif type(value) is IntType: return PgLargeObject(self.conn, value) else: *************** *** 614,618 **** for _i in range(len(lst)): ! if type(lst[_i]) == ListType: lst[_i] = self.handleArray(colinfo, lst[_i]) elif _ftv == PG_INT4 or _ftv == ROWID: --- 718,722 ---- for _i in range(len(lst)): ! if type(lst[_i]) is ListType: lst[_i] = self.handleArray(colinfo, lst[_i]) elif _ftv == PG_INT4 or _ftv == ROWID: *************** *** 674,679 **** # Description: A Python wrapper class for the PostgreSQL types that do | # not (yet) have an implementation in python. The number | ! # of types in this catagory will shrink as more wrappers | ! # are implementated. | # | # Note: A Python String is used to store the PostgreSQL type in | --- 778,783 ---- # Description: A Python wrapper class for the PostgreSQL types that do | # not (yet) have an implementation in python. The number | ! # of types in this category will shrink as more wrappers | ! # are implemented. | # | # Note: A Python String is used to store the PostgreSQL type in | *************** *** 683,687 **** class PgOther: def __init__(self, value): ! if type(value) != StringType: raise TypeError, "argument must be a string." --- 787,791 ---- class PgOther: def __init__(self, value): ! if type(value) is not StringType: raise TypeError, "argument must be a string." *************** *** 737,741 **** class PgBytea: def __init__(self, value): ! if type(value) != StringType: raise TypeError, "argument must be a string." --- 841,845 ---- class PgBytea: def __init__(self, value): ! if type(value) is not StringType: raise TypeError, "argument must be a string." *************** *** 789,798 **** class PgNumeric: def __init__(self, value, prec=None, scale=None): ! if type(value) == LongType or type(value) == IntType or value == None: ! if prec == None or scale == None: raise TypeError, \ "you must supply precision and scale when value is a " \ "integer, long, or None" ! if value == None: self.__v = value else: --- 893,902 ---- class PgNumeric: def __init__(self, value, prec=None, scale=None): ! if type(value) is LongType or type(value) is IntType or value is None: ! if prec is None or scale is None: raise TypeError, \ "you must supply precision and scale when value is a " \ "integer, long, or None" ! if value is None: self.__v = value else: *************** *** 802,806 **** return ! if type(value) != StringType: raise TypeError, "value must be a string." --- 906,910 ---- return ! if type(value) is not StringType: raise TypeError, "value must be a string." *************** *** 866,870 **** # a trailing 'L', if so, remove it. Python 1.5 has the trailing 'L', # Python 1.6 does not. ! if value == None: _v = str(self.__v) else: --- 970,974 ---- # a trailing 'L', if so, remove it. Python 1.5 has the trailing 'L', # Python 1.6 does not. ! if value is None: _v = str(self.__v) else: *************** *** 900,904 **** if type(other) in [IntType, LongType]: _s = str(other) ! elif type(other) == FloatType: _s = str(long(((other * (10.0 ** self.__s)) + 0.5))) elif type(other) == type(self): --- 1004,1008 ---- if type(other) in [IntType, LongType]: _s = str(other) ! elif type(other) is FloatType: _s = str(long(((other * (10.0 ** self.__s)) + 0.5))) elif type(other) == type(self): *************** *** 1022,1026 **** class PgMoney: def __init__(self, value): ! if value == None: self.value = value return --- 1126,1130 ---- class PgMoney: def __init__(self, value): ! if value is None: self.value = value return *************** *** 1037,1044 **** def __coerce__(self, other): ! if other == None: return None res = coerce(self.value, other) ! if res == None: return None _s, _o = res --- 1141,1148 ---- def __coerce__(self, other): ! if other is None: return None res = coerce(self.value, other) ! if res is None: return None _s, _o = res *************** *** 1156,1160 **** class PgInt8: def __init__(self, value): ! if value == None: self.value = value return --- 1260,1264 ---- class PgInt8: def __init__(self, value): ! if value is None: self.value = value return *************** *** 1171,1178 **** def __coerce__(self, other): ! if other == None: return None res = coerce(self.value, other) ! if res == None: return None _s, _o = res --- 1275,1282 ---- def __coerce__(self, other): ! if other is None: return None res = coerce(self.value, other) ! if res is None: return None _s, _o = res *************** *** 1323,1327 **** # Now we set up attributes based on the column names in the result set self.__dict__['_xlatkey'] = {} ! if mapname == None: for _i in range(len(description)): self.__dict__['_xlatkey'][description[_i][0]] = _i --- 1427,1431 ---- # Now we set up attributes based on the column names in the result set self.__dict__['_xlatkey'] = {} ! if mapname is None: for _i in range(len(description)): self.__dict__['_xlatkey'][description[_i][0]] = _i *************** *** 1350,1359 **** def __getitem__(self, key): ! if type(key) == StringType: key = self._xlatkey[key] return self.baseObj[key] def __setitem__(self, key, value): ! if type(key) == StringType: key = self._xlatkey[key] self.baseObj[key] = value --- 1454,1463 ---- def __getitem__(self, key): ! if type(key) is StringType: key = self._xlatkey[key] return self.baseObj[key] def __setitem__(self, key, value): ! if type(key) is StringType: key = self._xlatkey[key] self.baseObj[key] = value *************** *** 1425,1429 **** # Define the PgSQL function calls: | # | ! # connect() -- connecnt to a PostgreSQL database. | # _handleArray() -- Transform a Python list into a string repre- | # senting a PostgreSQL array. | --- 1529,1533 ---- # Define the PgSQL function calls: | # | ! # connect() -- connect to a PostgreSQL database. | # _handleArray() -- Transform a Python list into a string repre- | # senting a PostgreSQL array. | *************** *** 1447,1451 **** # Try getting values from the DSN first. ! if dsn != None: try: params = string.split(dsn, ":") --- 1551,1555 ---- # Try getting values from the DSN first. ! if dsn is not None: try: params = string.split(dsn, ":") *************** *** 1461,1467 **** # Override from the keyword arguments, if needed. ! if (user != None): _d["user"] = user ! if (password != None): _d["password"] = password ! if (host != None): _d["host"] = host try: --- 1565,1571 ---- # Override from the keyword arguments, if needed. ! if (user is not None): _d["user"] = user ! if (password is not None): _d["password"] = password ! if (host is not None): _d["host"] = host try: *************** *** 1471,1478 **** except: pass ! if (database != None): _d["dbname"] = database ! if (port != None): _d["port"] = port ! if (options != None): _d["options"] = options ! if (tty != None): _d["tty"] = tty # Build up the connection info string passed to PQconnectdb --- 1575,1582 ---- except: pass ! if (database is not None): _d["dbname"] = database ! if (port is not None): _d["port"] = port ! if (options is not None): _d["options"] = options ! if (tty is not None): _d["tty"] = tty # Build up the connection info string passed to PQconnectdb *************** *** 1497,1511 **** _j = "'{" for _i in value: ! if type(_i) in [ListType, TupleType]: _v = list(_i) ! _j = _j + _handleArray(_v) + ',' elif hasattr(_i, '_quote'): _j = '%s%s,' % (_j, _i._quote(1)) elif type(_i) in [DateTime.DateTimeType, DateTime.DateTimeDeltaType]: _j = '%s"%s",' % (_j, _i) ! elif type(_i) == PgInt2Type or type(_i) == PgInt8Type: _j = '%s%s,' % (_j, str(_i)) else: ! _j = '%s%s,' % (_j, PgQuoteString(_i, 1)) return _j[:-1] + "}'" --- 1601,1617 ---- _j = "'{" for _i in value: ! if _i is None: ! _j += "," ! elif type(_i) in [ListType, TupleType]: _v = list(_i) ! _j = _j + _handleArray(_v)[1:-1] + ',' elif hasattr(_i, '_quote'): _j = '%s%s,' % (_j, _i._quote(1)) elif type(_i) in [DateTime.DateTimeType, DateTime.DateTimeDeltaType]: _j = '%s"%s",' % (_j, _i) ! elif type(_i) is PgInt2Type or type(_i) is PgInt8Type: _j = '%s%s,' % (_j, str(_i)) else: ! _j = '%s%s,' % (_j, PgQuoteString(str(_i), 1)) return _j[:-1] + "}'" *************** *** 1521,1525 **** quoting.""" ! if value == None: return 'NULL' --- 1627,1631 ---- quoting.""" ! if value is None: return 'NULL' *************** *** 1533,1537 **** return "'%s'" % value ! if type(value) == StringType: return PgQuoteString(value) --- 1639,1643 ---- return "'%s'" % value ! if type(value) is StringType: return PgQuoteString(value) *************** *** 1544,1556 **** insertion.""" ! if type(vdict) == DictType or isinstance(vdict, PgResultSet): t = {} for k, v in vdict.items(): t[k]=_quote(v) ! elif type(vdict) == StringType: # Note: a string is a SequenceType, but is treated as a single # entity, not a sequence of characters. t = (_quote(vdict), ) ! elif type(vdict)in [ListType, TupleType]: t = tuple(map(_quote, vdict)) else: --- 1650,1662 ---- insertion.""" ! if type(vdict) is DictType or isinstance(vdict, PgResultSet): t = {} for k, v in vdict.items(): t[k]=_quote(v) ! elif type(vdict) is StringType: # Note: a string is a SequenceType, but is treated as a single # entity, not a sequence of characters. t = (_quote(vdict), ) ! elif type(vdict) in [ListType, TupleType]: t = tuple(map(_quote, vdict)) else: *************** *** 1599,1606 **** def __setattr__(self, name, value): if name == "autocommit": ! if value == None: raise InterfaceError, \ "Can't delete the autocommit attribute." ! # Don't allow autocommit to change if there are any opened cursors # associated with this connection. if self.__anyLeft(): --- 1705,1712 ---- def __setattr__(self, name, value): if name == "autocommit": ! if value is None: raise InterfaceError, \ "Can't delete the autocommit attribute." ! # Don't allow autocommit to change if there are any opened cursor # associated with this connection. if self.__anyLeft(): *************** *** 1630,1634 **** self.__dict__[name] = 0 elif name == "TransactionLevel": ! if value == None: raise InterfaceError, \ "Can't delete the TransactinLevel attribute." --- 1736,1740 ---- self.__dict__[name] = 0 elif name == "TransactionLevel": ! if value is None: raise InterfaceError, \ "Can't delete the TransactinLevel attribute." *************** *** 1656,1660 **** self.rollback() ! if type(value) != StringType: raise ValueError, "TransactionLevel must be a string." --- 1762,1766 ---- self.rollback() ! if type(value) is not StringType: raise ValueError, "TransactionLevel must be a string." *************** *** 1845,1851 **** "unlink of a PostgreSQL Large Object in a transaction" ! if type(lobj) == IntType: oid = lobj ! elif type(lobj) == PgLargeObjectType: oid = lobj.oid --- 1951,1957 ---- "unlink of a PostgreSQL Large Object in a transaction" ! if type(lobj) is IntType: oid = lobj ! elif type(lobj) is PgLargeObjectType: oid = lobj.oid *************** *** 1873,1879 **** # Generate a unique name for the cursor is one is not given. ! if name == None: name = "PgSQL_%08X" % id(self) ! elif type(name) != StringType: raise TypeError, "Cursor name must be a string." --- 1979,1985 ---- # Generate a unique name for the cursor is one is not given. ! if name is None: name = "PgSQL_%08X" % id(self) ! elif type(name) is not StringType: raise TypeError, "Cursor name must be a string." *************** *** 2097,2101 **** raise InterfaceError, "callproc failed - the cursor is closed." ! if self.conn == None: raise Error, "connection is closed." --- 2203,2207 ---- raise InterfaceError, "callproc failed - the cursor is closed." ! if self.conn is None: raise Error, "connection is closed." *************** *** 2130,2134 **** self._rows_ = self.res.ntuples self._idx_ = 0 ! if type(self.res) != PgResultType: self.__dict__['rowcount'] = -1 else: --- 2236,2240 ---- self._rows_ = self.res.ntuples self._idx_ = 0 ! if type(self.res) is not PgResultType: self.__dict__['rowcount'] = -1 else: *************** *** 2191,2195 **** raise InterfaceError, "execute failed - the cursor is closed." ! if self.conn == None: raise Error, "connection is closed." --- 2297,2301 ---- raise InterfaceError, "execute failed - the cursor is closed." ! if self.conn is None: raise Error, "connection is closed." *************** *** 2262,2266 **** self._idx_ = 0 self.__dict__['rowcount'] = -1 # New query - no fetch occured yet. ! if type(self.res) != PgResultType: self.__dict__['rowcount'] = -1 else: --- 2368,2372 ---- self._idx_ = 0 self.__dict__['rowcount'] = -1 # New query - no fetch occured yet. ! if type(self.res) is not PgResultType: self.__dict__['rowcount'] = -1 else: *************** *** 2315,2319 **** raise InterfaceError, "executemany failed - the cursor is closed." ! if self.conn == None: raise Error, "connection is closed." --- 2421,2425 ---- raise InterfaceError, "executemany failed - the cursor is closed." ! if self.conn is None: raise Error, "connection is closed." *************** *** 2325,2336 **** raise InterfaceError, "fetchone failed - the cursor is closed." ! if self.conn == None: raise Error, "connection is closed." ! if self.res == None: raise Error, \ "fetchone() failed - cursor does not contain a result." elif self.res.resultType != RESULT_DQL: ! if self.closed == None: raise Error, \ "fetchone() Failed - cursor does not contain any rows." --- 2431,2442 ---- raise InterfaceError, "fetchone failed - the cursor is closed." ! if self.conn is None: raise Error, "connection is closed." ! if self.res is None: raise Error, \ "fetchone() failed - cursor does not contain a result." elif self.res.resultType != RESULT_DQL: ! if self.closed is None: raise Error, \ "fetchone() Failed - cursor does not contain any rows." *************** *** 2355,2370 **** raise InterfaceError, "fetchmany failed - the cursor is closed." ! if self.conn == None: raise Error, "connection is closed." ! if self.res == None: raise Error, \ "fetchmany() failed - cursor does not contain a result." elif self.res.resultType != RESULT_DQL: ! if self.close == None: raise Error, \ "fetchmany() Failed - cursor does not contain any rows." ! if sz == None: sz = self.arraysize else: --- 2461,2476 ---- raise InterfaceError, "fetchmany failed - the cursor is closed." ! if self.conn is None: raise Error, "connection is closed." ! if self.res is None: raise Error, \ "fetchmany() failed - cursor does not contain a result." elif self.res.resultType != RESULT_DQL: ! if self.close is None: raise Error, \ "fetchmany() Failed - cursor does not contain any rows." ! if sz is None: sz = self.arraysize else: *************** *** 2402,2413 **** raise InterfaceError, "fetchall failed - the cursor is closed." ! if self.conn == None: raise Error, "connection is closed." ! if self.res == None: raise Error, \ "fetchall() failed - cursor does not contain a result." elif self.res.resultType != RESULT_DQL: ! if self.closed == None: raise Error, \ "fetchall() Failed - cursor does not contain any rows." --- 2508,2519 ---- raise InterfaceError, "fetchall failed - the cursor is closed." ! if self.conn is None: raise Error, "connection is closed." ! if self.res is None: raise Error, \ "fetchall() failed - cursor does not contain a result." elif self.res.resultType != RESULT_DQL: ! if self.closed is None: raise Error, \ "fetchall() Failed - cursor does not contain any rows." *************** *** 2438,2448 **** raise InterfaceError, "rewind failed - the cursor is closed." ! if self.conn == None: raise Error, "connection is closed." ! if self.res == None: raise Error, "rewind() failed - cursor does not contain a result." elif self.res.resultType != RESULT_DQL: ! if self.closed == None: raise Error, \ "rewind() Failed - cursor does not contain any rows." --- 2544,2554 ---- raise InterfaceError, "rewind failed - the cursor is closed." ! if self.conn is None: raise Error, "connection is closed." ! if self.res is None: raise Error, "rewind() failed - cursor does not contain a result." elif self.res.resultType != RESULT_DQL: ! if self.closed is None: raise Error, \ "rewind() Failed - cursor does not contain any rows." |
From: Gerhard H?r. <gha...@us...> - 2002-04-21 20:36:10
|
Update of /cvsroot/pypgsql/pypgsql In directory usw-pr-cvs1:/tmp/cvs-serv14160 Modified Files: libpqmodule.c Log Message: 21APR2002 gh Removed special escaping of control characters in arrays. Index: libpqmodule.c =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/libpqmodule.c,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** libpqmodule.c 4 Feb 2002 02:09:52 -0000 1.22 --- libpqmodule.c 21 Apr 2002 20:36:06 -0000 1.23 *************** *** 32,35 **** --- 32,37 ---- | Date Ini Description | | --------- --- ------------------------------------------------------- | + | 21APR2002 gh Removed special escaping of control characters in | + | arrays. | | 03FEB2002 bga Added code to support the PG_ACLTIEM and PG_MACADDR oid | | numbers [Bug #510244]. | *************** *** 267,276 **** byte = (unsigned char)sin[i]; sout[j++] = '\\'; - if (forArray) - { - sout[j++] = '\\'; - sout[j++] = '\\'; - sout[j++] = '\\'; - } sout[j++] = DIG((byte >> 6) & 3); sout[j++] = DIG((byte >> 3) & 7); --- 269,272 ---- |
From: Gerhard H?r. <gha...@us...> - 2002-04-17 00:25:22
|
Update of /cvsroot/pypgsql/pypgsql/test/regression In directory usw-pr-cvs1:/tmp/cvs-serv10326/regression Modified Files: pgconnection.py pgresult.py Log Message: 17APR2002 gh Fix some of the regression tests to also work with PostgreSQL version 7.2. I'm not sure what to to about the differences related to the output of cmdStatus, though. Index: pgconnection.py =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/test/regression/pgconnection.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** pgconnection.py 3 Nov 2001 19:03:49 -0000 1.4 --- pgconnection.py 17 Apr 2002 00:25:19 -0000 1.5 *************** *** 206,209 **** --- 206,216 ---- Test sendQuery, consumeInput, and getResult. """ + if self.vstr.startswith("7.2"): + flen = 9 + elif self.vstr.startswith("7.1"): + flen = 7 + else: + flen = 4 + try: cnx.sendQuery("""select * from pg_database *************** *** 220,224 **** self.assertEquals(res.ntuples, 1, 'Query return wrong number of tuples.') ! self.assertEquals(res.nfields, 7, 'Query return wrong number of fields.') if res.getvalue(0,0) != 'template1' or \ --- 227,231 ---- self.assertEquals(res.ntuples, 1, 'Query return wrong number of tuples.') ! self.assertEquals(res.nfields, flen, 'Query return wrong number of fields.') if res.getvalue(0,0) != 'template1' or \ Index: pgresult.py =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/test/regression/pgresult.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** pgresult.py 18 Oct 2001 03:17:08 -0000 1.8 --- pgresult.py 17 Apr 2002 00:25:19 -0000 1.9 *************** *** 231,238 **** def CheckPgResult(self): res = self.cnx.query("SELECT * FROM pg_database LIMIT 3") self.CheckForMembers(res) self.CheckForMethods(res) ! expected = [0, 'SELECT', None, 7, 3, None, 2, 1 ] self.CheckMemberValues(res, expected) --- 231,245 ---- def CheckPgResult(self): + if self.vstr.startswith("7.2"): + flen = 9 + elif self.vstr.startswith("7.1"): + flen = 7 + else: + flen = 4 + res = self.cnx.query("SELECT * FROM pg_database LIMIT 3") self.CheckForMembers(res) self.CheckForMethods(res) ! expected = [0, 'SELECT', None, flen, 3, None, 2, 1 ] self.CheckMemberValues(res, expected) *************** *** 463,466 **** --- 470,480 ---- def CheckPgResult(self): + if self.vstr.startswith("7.2"): + flen = 9 + elif self.vstr.startswith("7.1"): + flen = 7 + else: + flen = 4 + res = self.cnx.query("SELECT * FROM pg_database LIMIT 3") expected = [types.IntType, types.StringType, types.NoneType, *************** *** 468,472 **** types.IntType, types.IntType ] self.CheckMemberTypes(res, expected) ! expected = [0, 'SELECT', None, 7, 3, None, 2, 1 ] self.CheckMemberValues(res, expected) # Check that fname returns the expected results --- 482,486 ---- types.IntType, types.IntType ] self.CheckMemberTypes(res, expected) ! expected = [0, 'SELECT', None, flen, 3, None, 2, 1 ] self.CheckMemberValues(res, expected) # Check that fname returns the expected results |
From: Gerhard H?r. <gha...@us...> - 2002-04-17 00:18:27
|
Update of /cvsroot/pypgsql/pypgsql/test/regression In directory usw-pr-cvs1:/tmp/cvs-serv8720/test/regression Added Files: array.py Log Message: 17APR2002 gh Testcases for the array handling that demonstrate the current bugs on PostgreSQL 7.1 and 7.2. 7.2 is slightly better, but the un-escaping of libpq results will certainly still have to be much improved. --- NEW FILE: array.py --- #!/usr/local/bin/python #ident "@(#) $Id: array.py,v 1.1 2002/04/17 00:18:22 ghaering Exp $" # vi:set sw=4 ts=8 showmode ai: #-----------------------------------------------------------------------+ # Name: array.py | # | # Description: array.py contains test cases for using the PostgreSQL | # array type from within the PgSQL module. | # | # Note: These test cases requires that a test database named | # pypgsql exists and that the person running the test has | # full rights to the database. | #=======================================================================| # Copyright 2002 by Gerhard Häring. | # All rights reserved. | # | # Permission to use, copy, modify, and distribute this software and its | # documentation for any purpose and without fee is hereby granted, pro- | # vided that the above copyright notice appear in all copies and that | # both that copyright notice and this permission notice appear in sup- | # porting documentation, and that the copyright owner's name not be | # used in advertising or publicity pertaining to distribution of the | # software without specific, written prior permission. | # | # THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, | # INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN | # NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR | # CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS | # OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE | # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE | # USE OR PERFORMANCE OF THIS SOFTWARE. | #=======================================================================| # Revision History: | # | # Date Ini Description | # --------- --- ------------------------------------------------------- | # 16APR2002 gh Initial release by Gerhard Häring. | #-----------------------------------------------------------------------+ import unittest, types import sys from pyPgSQL import PgSQL class ArrayTestCases(unittest.TestCase): def setUp(self): self.conn = PgSQL.connect(database="pypgsql") def checkEqual(self, real, planned): self.failUnlessEqual(real, planned, \ "Received %s, should have been %s" % (repr(real), repr(planned))) def CheckForIntegerInsert(self): ivalues = [3,4,5] cursor = self.conn.cursor() cursor.execute("create table test (ia int[])") cursor.execute("insert into test(ia) values (%s)", (ivalues,)) cursor.execute("select ia from test") result = cursor.fetchone() self.failUnlessEqual(type(result.ia), types.ListType, \ "the integer array isn't returned as a list") self.checkEqual(result.ia, ivalues) self.conn.rollback() def CheckForNumericInsert(self): numlist = map(PgSQL.PgNumeric, ['4.7', '-3.2', '23.17']) cursor = self.conn.cursor() cursor.execute("create table test(na numeric[])") cursor.execute("insert into test(na) values (%s)", (numlist,)) cursor.execute("select na from test") result = cursor.fetchone() self.failUnlessEqual(type(result.na), types.ListType, \ "the numeric array isn't returned as a list") self.checkEqual(result.na, numlist) self.conn.rollback() def CheckForStringInsert(self): #self.conn.conn.toggleShowQuery cursor = self.conn.cursor() stringlists = [['hey', 'you', 'there'], ['fancy', ',', '{chars}', '"'], ['what about', 'some \\backslashes'], ['some more \\', '\\ and \\ etc'], ['aa', '%s\n%s' % (chr(10), chr(29))], ['what about backslashes', 'at the end\\'], ['interesting', '"', '\\"', '\\"\\'], ['{}\\', '"\\}}\\\'"']] for stringlist in stringlists: cursor.execute("create table test(va varchar[])") cursor.execute("insert into test(va) values (%s)", (stringlist,)) cursor.execute("select va from test") result = cursor.fetchone() self.failUnlessEqual(type(result.va), types.ListType, \ "the varchar array isn't returned as a list") self.checkEqual(result.va, stringlist) self.conn.rollback() if __name__ == "__main__": TestSuite = unittest.TestSuite() TestSuite.addTest(ArrayTestCases("CheckForIntegerInsert")) TestSuite.addTest(ArrayTestCases("CheckForNumericInsert")) TestSuite.addTest(ArrayTestCases("CheckForStringInsert")) runner = unittest.TextTestRunner() runner.run(TestSuite) |
From: Gerhard H?r. <gha...@us...> - 2002-04-16 00:14:07
|
Update of /cvsroot/pypgsql/pypgsql In directory usw-pr-cvs1:/tmp/cvs-serv12078 Modified Files: pgversion.c Log Message: 16APR2002 gh pgversion.c: Replace _tolower with the standard C tolower function, to make this file compile on FreeBSD. pyPgSQL/PgSQL.py: Fix the array parsing so it also works with PostgreSQL versions 7.2.x. The PostgreSQL developers changed the quoting in the string representation of arrays in 7.2 beta cycle: strings are now only quoted when otherwise the array representation would be ambiguous. The new parseArray() method should handle the old and new way of quoting in arrays. [Bug #539769]. test/PgSQLTestCases.py: Updated the PostgreSQL version specific tests to cope with PostgreSQL 7.2.x. Index: pgversion.c =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/pgversion.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** pgversion.c 1 Feb 2002 22:59:39 -0000 1.14 --- pgversion.c 16 Apr 2002 00:14:01 -0000 1.15 *************** *** 32,35 **** --- 32,37 ---- | Date Ini Description | | --------- --- ------------------------------------------------------- | + | 16APR2002 gh Replace _tolower with the standard C tolower function, | + | to make this file compile on FreeBSD. | | 21JAN2002 bga Expanded the fix of 12JAN2002 to also handle beta ver- | | sions of PostgreSQL. | *************** *** 126,134 **** { if (isupper(*s1)) ! c1 = _tolower(*s1); else c1 = *s1; if (isupper(*s2)) ! c2 = _tolower(*s2); else c2 = *s2; --- 128,136 ---- { if (isupper(*s1)) ! c1 = tolower(*s1); else c1 = *s1; if (isupper(*s2)) ! c2 = tolower(*s2); else c2 = *s2; |
From: Gerhard H?r. <gha...@us...> - 2002-04-16 00:14:06
|
Update of /cvsroot/pypgsql/pypgsql/pyPgSQL In directory usw-pr-cvs1:/tmp/cvs-serv12078/pyPgSQL Modified Files: PgSQL.py Log Message: 16APR2002 gh pgversion.c: Replace _tolower with the standard C tolower function, to make this file compile on FreeBSD. pyPgSQL/PgSQL.py: Fix the array parsing so it also works with PostgreSQL versions 7.2.x. The PostgreSQL developers changed the quoting in the string representation of arrays in 7.2 beta cycle: strings are now only quoted when otherwise the array representation would be ambiguous. The new parseArray() method should handle the old and new way of quoting in arrays. [Bug #539769]. test/PgSQLTestCases.py: Updated the PostgreSQL version specific tests to cope with PostgreSQL 7.2.x. Index: PgSQL.py =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/pyPgSQL/PgSQL.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PgSQL.py 4 Feb 2002 02:09:52 -0000 1.7 --- PgSQL.py 16 Apr 2002 00:14:01 -0000 1.8 *************** *** 30,33 **** --- 30,40 ---- # Date Ini Description | # --------- --- ------------------------------------------------------- | + # 16APR2002 gh Fix the array parsing so it also works with PostgreSQL | + # versions 7.2.x. The PostgreSQL developers changed the | + # quoting in the string representation of arrays in 7.2 | + # beta cycle: strings are now only quoted when otherwise | + # the array representation would be ambiguous. The new | + # parseArray() method should handle the old and new way | + # of quoting in arrays. [Bug #539769]. | # 01FEB2002 bga Fixed a couple of problems found by Steven D. Arnold: | # 1. A undefined variable was used in a few places where | *************** *** 469,472 **** --- 476,538 ---- self.__conn = None + def parseArray(self, s): + """Parse a PostgreSQL array strings representation. + This parses a PostgreSQL array and return a list of the array + elements as strings. + """ + class LeaveLoopException(Exception): pass + + lst = [] + s = s[1:-1] # drop '{' and '}' at start/end + + # If the array is empty, return immediately + if len(s) == 0: + return lst + + pos = 0 + try: + while 1: + if s[pos] == '"': + # A quoted element, find the end-quote, which is the next + # quote char that is not escaped. + end_quote_pos = pos + while 1: + end_quote_pos = s.find('"', end_quote_pos + 1) + assert(end_quote_pos > pos) + if s[end_quote_pos - 1] != '\\': + break + lst.append(s[pos + 1:end_quote_pos]) + + # Skip quote char and next comma + pos = end_quote_pos + 2 + + # If end-of-string. leave loop. + if pos >= len(s): + break + else: + # This array element is not quoted, so it ends either at + # the next comma that isn't escaped, or at the end of the + # string. + next_comma_pos = pos + while 1: + next_comma_pos = s.find(',', next_comma_pos + 1) + if next_comma_pos < 0: + # This is the last array element. + lst.append(s[pos:]) + raise LeaveLoopException + else: + if s[next_comma_pos - 1] != '\\': + break + lst.append(s[pos:next_comma_pos]) + pos = next_comma_pos + 1 + except LeaveLoopException: + pass + + # Get rid of the array's backslash escaping level + def convertEscapes(s): + return s.replace('\\"', '"') + lst = map(convertEscapes, lst) + return lst + def typecast(self, colinfo, value): """ *************** *** 484,488 **** if _ia: # Convert string representation of the array into list. ! exec "_list = %s" % replace(replace(value, '{', '['), '}', ']') return self.handleArray(colinfo, _list) --- 550,554 ---- if _ia: # Convert string representation of the array into list. ! _list = self.parseArray(value) return self.handleArray(colinfo, _list) *************** *** 571,575 **** # There is no need to un-escape lst[_i], it's already been # done when the PostgreSQL array was converted to a list ! # via 'exec'. lst[_i] = PgBytea(lst[_i]) else: --- 637,641 ---- # There is no need to un-escape lst[_i], it's already been # done when the PostgreSQL array was converted to a list ! # via parseArray(). lst[_i] = PgBytea(lst[_i]) else: |
From: Gerhard H?r. <gha...@us...> - 2002-04-16 00:14:06
|
Update of /cvsroot/pypgsql/pypgsql/test In directory usw-pr-cvs1:/tmp/cvs-serv12078/test Modified Files: PgSQLTestCases.py Log Message: 16APR2002 gh pgversion.c: Replace _tolower with the standard C tolower function, to make this file compile on FreeBSD. pyPgSQL/PgSQL.py: Fix the array parsing so it also works with PostgreSQL versions 7.2.x. The PostgreSQL developers changed the quoting in the string representation of arrays in 7.2 beta cycle: strings are now only quoted when otherwise the array representation would be ambiguous. The new parseArray() method should handle the old and new way of quoting in arrays. [Bug #539769]. test/PgSQLTestCases.py: Updated the PostgreSQL version specific tests to cope with PostgreSQL 7.2.x. Index: PgSQLTestCases.py =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/test/PgSQLTestCases.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** PgSQLTestCases.py 18 Oct 2001 03:17:08 -0000 1.16 --- PgSQLTestCases.py 16 Apr 2002 00:14:01 -0000 1.17 *************** *** 33,36 **** --- 33,38 ---- # Date Ini Description | # --------- --- ------------------------------------------------------- | + # 16APR2002 gh Updated the PostgreSQL version specific tests to cope | + # with PostgreSQL 7.2.x. | # 09SEP2001 bga Modified tests to reflect changes to PgVersion object. | # In particulare, a PgVersion object no longer has a | *************** *** 475,479 **** """Test execute() with a singleton string as the parameter.""" ! if self.vstr == "7.1": flen = 7 else: --- 477,483 ---- """Test execute() with a singleton string as the parameter.""" ! if self.vstr == "7.2": ! flen = 9 ! elif self.vstr == "7.1": flen = 7 else: *************** *** 662,666 **** # Note: We only have to check for the minor version number in order # to determine the needed row counts. ! rc = { '7.1':80, '7.0':65, '6.5':47 } v = self.vstr --- 666,670 ---- # Note: We only have to check for the minor version number in order # to determine the needed row counts. ! rc = { '7.2':101, '7.1':80, '7.0':65, '6.5':47 } v = self.vstr |
From: Billy G. A. <bal...@us...> - 2002-02-04 02:12:06
|
Update of /cvsroot/pypgsql/pypgsql In directory usw-pr-cvs1:/tmp/cvs-serv2474 Modified Files: pgresult.c Log Message: 03FEB2002 bga Change the point at which an OID is tested to see if it is a Large Object from 1700 to 16383. Index: pgresult.c =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/pgresult.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** pgresult.c 2001/10/26 06:05:52 1.16 --- pgresult.c 2002/02/04 02:12:04 1.17 *************** *** 29,32 **** --- 29,35 ---- | Date Ini Description | | --------- --- ------------------------------------------------------- | + | 03FEB2002 bga Change the constant that is used to determine when to | + | check an OID to see if it is a Large Object form 1700 | + | (PG_NUMERIC) to 16383 (MAX_RESERVED_OID). | | 26OCT2001 bga [Bug #474771] Found and plugged a memory leak in the | | PgResult_New() function. An object for the value of | *************** *** 477,482 **** | this OID exist in the table. | | | ! | Note: Any OID <= 1700 (PG_NUMERIC) can not be a Large | ! | Object. | | | | Note: We cache weither or not an OID is a LargeObject | --- 480,485 ---- | this OID exist in the table. | | | ! | Note: Any OID <= MAX_RESERVED_OID (16383) can not be | ! | a Large Object. | | | | Note: We cache weither or not an OID is a LargeObject | *************** *** 489,497 **** return valueObj; ! if (PyInt_AS_LONG(valueObj) <= PG_NUMERIC) break; /*******************************************************\ ! | Check the cache to see if we already looked up the | | in the database. If we have, used the cached results.| \*******************************************************/ --- 492,500 ---- return valueObj; ! if (PyInt_AS_LONG(valueObj) <= MAX_RESERVED_OID) break; /*******************************************************\ ! | Check the cache to see if we already looked up the OID| | in the database. If we have, used the cached results.| \*******************************************************/ |
From: Billy G. A. <bal...@us...> - 2002-02-04 02:09:56
|
Update of /cvsroot/pypgsql/pypgsql/pyPgSQL In directory usw-pr-cvs1:/tmp/cvs-serv1981/pyPgSQL Modified Files: PgSQL.py Log Message: 03FEB2002 bga Added support for two missing OID types: aclitem and macaddr. Index: PgSQL.py =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/pyPgSQL/PgSQL.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PgSQL.py 2002/02/01 23:04:13 1.6 --- PgSQL.py 2002/02/04 02:09:52 1.7 *************** *** 396,400 **** OTHER = DBAPITypeObject('OTHER', PG_POINT, PG_LSEG, PG_PATH, PG_BOX, PG_POLYGON, PG_LINE, PG_CIDR, PG_CIRCLE, ! PG_INET) #-----------------------------------------------------------------------+ --- 396,400 ---- OTHER = DBAPITypeObject('OTHER', PG_POINT, PG_LSEG, PG_PATH, PG_BOX, PG_POLYGON, PG_LINE, PG_CIDR, PG_CIRCLE, ! PG_INET, PG_MACADDR, PG_ACLITEM) #-----------------------------------------------------------------------+ |
From: Billy G. A. <bal...@us...> - 2002-02-04 02:09:56
|
Update of /cvsroot/pypgsql/pypgsql In directory usw-pr-cvs1:/tmp/cvs-serv1981 Modified Files: pg_types.h libpqmodule.c libpqmodule.h Log Message: 03FEB2002 bga Added support for two missing OID types: aclitem and macaddr. Index: pg_types.h =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/pg_types.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pg_types.h 2001/09/24 07:10:56 1.3 --- pg_types.h 2002/02/04 02:09:52 1.4 *************** *** 1,2 **** --- 1,30 ---- + #ident "@(#) $Id$" + #ifndef Pg_TYPES_H + #define Pg_TYPES_H + #ifdef __cplusplus + extern "C" { + #endif + + /***********************************************************************\ + | Copyright 2001 by Billy G. Allie | + | All rights Reserved. | + | | + | Permission to use, copy, modify, and distribute this software and its | + | documentation for any purpose and without fee is hereby granted, pro- | + | vided that the above copyright notice appear in all copies and that | + | both that copyright notice and this permission notice appear in sup- | + | porting documentation, and that the copyright owner's name not be | + | used in advertising or publicity pertaining to distribution of the | + | software without specific, written prior permission. | + | | + | THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, | + | INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN | + | NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR | + | CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS | + | OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE | + | OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE | + | USE OR PERFORMANCE OF THIS SOFTWARE. | + \***********************************************************************/ + /* Character String */ #define PG_TEXT 25 *************** *** 13,16 **** --- 41,45 ---- #define PG_INTEGER PG_INT4 #define PG_INT2 21 + #define PG_SMALLINT PG_INT2 #define PG_INT8 20 #define PG_BIGINT PG_INT8 *************** *** 52,55 **** --- 81,85 ---- /* Network */ + #define PG_MACADDR 829 #define PG_INET 869 #define PG_CIDR 650 *************** *** 64,65 **** --- 94,101 ---- #define PG_OIDVECTOR 30 #define PG_UNKNOWN 705 + #define PG_ACLITEM 1033 + + #ifdef __cplusplus + } + #endif + #endif /* !Pg_TYPES_H */ Index: libpqmodule.c =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/libpqmodule.c,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** libpqmodule.c 2002/02/01 22:57:02 1.21 --- libpqmodule.c 2002/02/04 02:09:52 1.22 *************** *** 32,35 **** --- 32,37 ---- | Date Ini Description | | --------- --- ------------------------------------------------------- | + | 03FEB2002 bga Added code to support the PG_ACLTIEM and PG_MACADDR oid | + | numbers [Bug #510244]. | | 21JAN2002 bga Applied patch by Chris Bainbridge [Patch #505941]. | | 13OCT2001 bga Added support for the pickling of libpq objects. In | *************** *** 727,730 **** --- 729,733 ---- { case PG_ABSTIME: desc = "abstime"; break; + case PG_ACLITEM: desc = "aclitem"; break; case PG_BLOB: desc = "blob"; break; case PG_BOOL: desc = "bool"; break; *************** *** 748,751 **** --- 751,755 ---- case PG_LINE: desc = "line" ; break; case PG_LSEG: desc = "lseg"; break; + case PG_MACADDR: desc = "macaddr"; break; case PG_NAME: desc = "name"; break; case PG_NUMERIC: desc = "numeric"; break; *************** *** 1070,1073 **** --- 1074,1079 ---- PyDict_SetItemString(d, "PG_ABSTIME", Py_BuildValue("i", PG_ABSTIME)); + PyDict_SetItemString(d, "PG_ACLITEM", Py_BuildValue("i", PG_ACLITEM)); + PyDict_SetItemString(d, "PG_BIGINT", Py_BuildValue("i", PG_INT8)); PyDict_SetItemString(d, "PG_BLOB", Py_BuildValue("i", PG_BLOB)); PyDict_SetItemString(d, "PG_BOOL", Py_BuildValue("i", PG_BOOL)); *************** *** 1075,1078 **** --- 1081,1085 ---- PyDict_SetItemString(d, "PG_BPCHAR", Py_BuildValue("i", PG_BPCHAR)); PyDict_SetItemString(d, "PG_BYTEA", Py_BuildValue("i", PG_BYTEA)); + PyDict_SetItemString(d, "PG_CASH", Py_BuildValue("i", PG_CASH)); PyDict_SetItemString(d, "PG_CHAR", Py_BuildValue("i", PG_CHAR)); PyDict_SetItemString(d, "PG_CID", Py_BuildValue("i", PG_CID)); *************** *** 1080,1083 **** --- 1087,1091 ---- PyDict_SetItemString(d, "PG_CIRCLE", Py_BuildValue("i", PG_CIRCLE)); PyDict_SetItemString(d, "PG_DATE", Py_BuildValue("i", PG_DATE)); + PyDict_SetItemString(d, "PG_FLOAT", Py_BuildValue("i", PG_FLOAT8)); PyDict_SetItemString(d, "PG_FLOAT4", Py_BuildValue("i", PG_FLOAT4)); PyDict_SetItemString(d, "PG_FLOAT8", Py_BuildValue("i", PG_FLOAT8)); *************** *** 1087,1093 **** --- 1095,1103 ---- PyDict_SetItemString(d, "PG_INT4", Py_BuildValue("i", PG_INT4)); PyDict_SetItemString(d, "PG_INT8", Py_BuildValue("i", PG_INT8)); + PyDict_SetItemString(d, "PG_INTEGER", Py_BuildValue("i", PG_INT4)); PyDict_SetItemString(d, "PG_INTERVAL", Py_BuildValue("i", PG_INTERVAL)); PyDict_SetItemString(d, "PG_LINE", Py_BuildValue("i", PG_LINE)); PyDict_SetItemString(d, "PG_LSEG", Py_BuildValue("i", PG_LSEG)); + PyDict_SetItemString(d, "PG_MACADDR", Py_BuildValue("i", PG_MACADDR)); PyDict_SetItemString(d, "PG_MONEY", Py_BuildValue("i", PG_CASH)); PyDict_SetItemString(d, "PG_NAME", Py_BuildValue("i", PG_NAME)); *************** *** 1101,1104 **** --- 1111,1115 ---- PyDict_SetItemString(d, "PG_RELTIME", Py_BuildValue("i", PG_RELTIME)); PyDict_SetItemString(d, "PG_ROWID", Py_BuildValue("i", PG_ROWID)); + PyDict_SetItemString(d, "PG_SMALLINT", Py_BuildValue("i", PG_INT2)); PyDict_SetItemString(d, "PG_TEXT", Py_BuildValue("i", PG_TEXT)); PyDict_SetItemString(d, "PG_TID", Py_BuildValue("i", PG_TID)); Index: libpqmodule.h =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/libpqmodule.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** libpqmodule.h 2001/10/05 08:22:18 1.7 --- libpqmodule.h 2002/02/04 02:09:52 1.8 *************** *** 54,57 **** --- 54,63 ---- /***********************************************************************\ + | The following 'MAGIC' number defines that last reserved OID. | + \***********************************************************************/ + + #define MAX_RESERVED_OID 16383 /* 2^14 - 1 */ + + /***********************************************************************\ | It appears that versions of PostgreSQL prior to version 7.1 do not | | define InvalidOid, at least not in an area accessable to external | |
From: Billy G. A. <bal...@us...> - 2002-02-01 23:04:16
|
Update of /cvsroot/pypgsql/pypgsql/pyPgSQL In directory usw-pr-cvs1:/tmp/cvs-serv13763/pyPgSQL Modified Files: PgSQL.py Log Message: 01FEB2002 bga - Fixed a couple of problems found by Steven D. Arnold: 1. A undefined variable was used in a few places where notices were popped from the notice list. 2. Comparisons between 2 PgNumerics gave the wrong result. 18JAN2002 bga - Fixed problem that occurs when the sum() aggregate returns a NULL. [Bug #505162]. Index: PgSQL.py =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/pyPgSQL/PgSQL.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PgSQL.py 2002/01/12 23:20:14 1.5 --- PgSQL.py 2002/02/01 23:04:13 1.6 *************** *** 30,33 **** --- 30,40 ---- # Date Ini Description | # --------- --- ------------------------------------------------------- | + # 01FEB2002 bga Fixed a couple of problems found by Steven D. Arnold: | + # 1. A undefined variable was used in a few places where | + # notices were popped from the notice list. | + # 2. Comparisons between 2 PgNumerics gave the wrong re- | + # sult. | + # 18JAN2002 bga Fixed problem that occurs when the sum() aggregate re- | + # turns a NULL. [Bug #505162]. | # 04DEC2001 bga Added code to implement support for setting PostgreSQL | # transaction levels. [Feature Request #481727]. | *************** *** 872,875 **** --- 879,896 ---- return PgNumeric(self._round(_q, 1), self.__p, self.__s) + def __cmp__(self, other): + if self.__s < other.__s: + _d = other.__s - self.__s + _s = (self.__v * (10L ** _d)) + _o = other.__v + elif self.__s > other.__s: + _d = self.__s - other.__s + _s = self.__v + _o = (other.__v * (10L ** _d)) + else: + _s = self.__v + _o = other.__v + return cmp(_s, _o) + def __add__(self, other): if self.__s < other.__s: *************** *** 1637,1641 **** self.conn.query("ROLLBACK WORK") if len(self.conn.notices) != _nl: ! raise Warning, self.__conn.notices.pop() except: pass --- 1658,1662 ---- self.conn.query("ROLLBACK WORK") if len(self.conn.notices) != _nl: ! raise Warning, self.conn.notices.pop() except: pass *************** *** 1722,1726 **** self.conn.TransactionLevel) if len(self.conn.notices) != _nl: ! raise Warning, self.__conn.notices.pop() self.conn.__dict__["inTransaction"] = 1 --- 1743,1747 ---- self.conn.TransactionLevel) if len(self.conn.notices) != _nl: ! raise Warning, self.conn.notices.pop() self.conn.__dict__["inTransaction"] = 1 *************** *** 1830,1834 **** self.conn.TransactionLevel) if len(self.conn.notices) != _nl: ! raise Warning, self.__conn.notices.pop() self.conn.__dict__["inTransaction"] = 1 --- 1851,1855 ---- self.conn.TransactionLevel) if len(self.conn.notices) != _nl: ! raise Warning, self.conn.notices.pop() self.conn.__dict__["inTransaction"] = 1 *************** *** 1969,1973 **** _p = nv.getPrecision() _s = nv.getScale() ! except ValueError, m: _p = 30 _s = 6 --- 1990,1994 ---- _p = nv.getPrecision() _s = nv.getScale() ! except (ValueError, TypeError), m: _p = 30 _s = 6 *************** *** 2026,2030 **** self.conn.TransactionLevel) if len(self.conn.notices) != _nl: ! raise Warning, self.__conn.notices.pop() self.conn.__dict__["inTransaction"] = 1 --- 2047,2051 ---- self.conn.TransactionLevel) if len(self.conn.notices) != _nl: ! raise Warning, self.conn.notices.pop() self.conn.__dict__["inTransaction"] = 1 *************** *** 2192,2196 **** self.conn.conn.query('ROLLBACK WORK') if len(self.conn.notices) != _n: ! raise Warning, self.__conn.notices.pop() self.conn.__dict__["inTransaction"] = 0 self.conn._Connection__closeCursors() --- 2213,2217 ---- self.conn.conn.query('ROLLBACK WORK') if len(self.conn.notices) != _n: ! raise Warning, self.conn.notices.pop() self.conn.__dict__["inTransaction"] = 0 self.conn._Connection__closeCursors() |
From: Billy G. A. <bal...@us...> - 2002-02-01 22:59:43
|
Update of /cvsroot/pypgsql/pypgsql In directory usw-pr-cvs1:/tmp/cvs-serv12897 Modified Files: pgversion.c Log Message: 21JAN2002 bga - Expanded the fix of 12JAN2002 to also handle beta versions of PostgreSQL. Index: pgversion.c =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/pgversion.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** pgversion.c 2002/01/12 22:38:43 1.13 --- pgversion.c 2002/02/01 22:59:39 1.14 *************** *** 32,35 **** --- 32,37 ---- | Date Ini Description | | --------- --- ------------------------------------------------------- | + | 21JAN2002 bga Expanded the fix of 12JAN2002 to also handle beta ver- | + | sions of PostgreSQL. | | 12JAN2002 bga [Bug #486151] fixed a problem that prevented a connec- | | tion to be made to version 7.2devel of PostgreSQL. | *************** *** 170,176 **** --- 172,183 ---- *result = strtol(token, &last, 0); + /* Allow for development versions */ if (stricmp(last, "devel") == 0) return (errno != 0); + /* Allow for alpha and beta versions */ + if (((*last == 'a') || (*last == 'b')) && isdigit(*(last+1))) + return (errno != 0); + return ((errno != 0) || (*last != (char)0)); } |
From: Billy G. A. <bal...@us...> - 2002-02-01 22:57:05
|
Update of /cvsroot/pypgsql/pypgsql In directory usw-pr-cvs1:/tmp/cvs-serv12240 Modified Files: libpqmodule.c Log Message: 21JAN2002 bga - Applied patch by Chris Bainbridge [Patch #505941]. Index: libpqmodule.c =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/libpqmodule.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** libpqmodule.c 2001/10/13 20:40:35 1.20 --- libpqmodule.c 2002/02/01 22:57:02 1.21 *************** *** 32,35 **** --- 32,36 ---- | Date Ini Description | | --------- --- ------------------------------------------------------- | + | 21JAN2002 bga Applied patch by Chris Bainbridge [Patch #505941]. | | 13OCT2001 bga Added support for the pickling of libpq objects. In | | particular, for PgVersion and PgConnection objects. | *************** *** 332,336 **** /* Calculate the size for the new memory string. */ - slen = strlen((char *)sin); i = (slen * (forArray ? 8 : 4)) + 3; --- 333,336 ---- |
From: Billy G. A. <bal...@us...> - 2002-02-01 22:55:13
|
Update of /cvsroot/pypgsql/pypgsql In directory usw-pr-cvs1:/tmp/cvs-serv11243 Modified Files: README Log Message: 12JAN2002 bga - Added documentation for the new TransactionLevel attribute of the Connection object. Index: README =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/README,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** README 2001/11/05 01:18:12 1.20 --- README 2002/02/01 22:55:09 1.21 *************** *** 1315,1318 **** --- 1315,1325 ---- Object from the database. + 5. A PgSQL specific Connection attribute, called TransactionLevel, specifies + the isolation level to use within a transaction. It can be set to "", + "READ COMMITED", or "SERIALIZABLE". PgSQL will issue the appropiate "SET + TRANSACTION LEVEL" statement whenever a new transaction is started for + the connection. Note: The value of this attribute can not be changed if + there are any active cursors for the connection. + 2.2.3.1 unlink -------------- |
From: Billy G. A. <bal...@us...> - 2002-01-12 23:20:17
|
Update of /cvsroot/pypgsql/pypgsql/pyPgSQL In directory usw-pr-cvs1:/tmp/cvs-serv20407/pyPgSQL Modified Files: PgSQL.py Log Message: 04DEC2001 bga Added code to implement support for setting PostgreSQL trans- action levels. [Feature Request #481727]. 12JAN2001 bga Added test to check for correct operation of the fix for bug #486151. Index: PgSQL.py =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/pyPgSQL/PgSQL.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PgSQL.py 2001/11/03 18:36:50 1.4 --- PgSQL.py 2002/01/12 23:20:14 1.5 *************** *** 30,33 **** --- 30,35 ---- # Date Ini Description | # --------- --- ------------------------------------------------------- | + # 04DEC2001 bga Added code to implement support for setting PostgreSQL | + # transaction levels. [Feature Request #481727]. | # 03NOV2001 bga It appears that under certain circumstances, PostgreSQL | # will not return a precision/scale value for a numeric | *************** *** 161,170 **** an exception. [...1447 lines suppressed...] if self.conn == None: *************** *** 2313,2320 **** def setinputsizes(self, sizes): ! if self.closed: ! raise InterfaceError, "setinputsize failed - the cursor is closed." def setoutputsize(self, size, column=None): ! if self.closed: ! raise InterfaceError, "setoutputsize failed - the cursor is closed." --- 2375,2382 ---- def setinputsizes(self, sizes): ! if self.closed: ! raise InterfaceError, "setinputsize failed - the cursor is closed." def setoutputsize(self, size, column=None): ! if self.closed: ! raise InterfaceError, "setoutputsize failed - the cursor is closed." |
From: Billy G. A. <bal...@us...> - 2002-01-12 23:20:17
|
Update of /cvsroot/pypgsql/pypgsql/test/regression In directory usw-pr-cvs1:/tmp/cvs-serv20407/test/regression Modified Files: pgversion.py Log Message: 04DEC2001 bga Added code to implement support for setting PostgreSQL trans- action levels. [Feature Request #481727]. 12JAN2001 bga Added test to check for correct operation of the fix for bug #486151. Index: pgversion.py =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/test/regression/pgversion.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** pgversion.py 2001/10/18 03:17:08 1.4 --- pgversion.py 2002/01/12 23:20:14 1.5 *************** *** 34,37 **** --- 34,39 ---- # Date Ini Description | # --------- --- ------------------------------------------------------- | + # 12JAN2001 bga Added test to check for correct operation of the fix | + # for bug #486151. | # 21SEP2001 bga Added check of the member types in the sanity check. | # 16SEP2001 bga Change tests to reflect changes in pgversion.c. | *************** *** 140,148 **** else: vers == '7.1 on' ! self.fail( ! 'Comparison to badly formatted string succeeded.' ! ) except ValueError, msg: pass try: --- 142,166 ---- else: vers == '7.1 on' ! self.fail('Comparison to badly formatted string succeeded.') except ValueError, msg: pass + + try: + if version < 20100: + a, b = coerce(vers, '7.1devel') + vers == b + else: + vers == '7.1devel' + except ValueError, msg: + self.fail('Comparison to development version failed.') + + try: + if version < 20100: + a, b = coerce(vers, '7.1Devel') + vers == b + else: + vers == '7.1Devel' + except ValueError, msg: + self.fail('Comparison to development version failed.') try: |
From: Billy G. A. <bal...@us...> - 2002-01-12 22:38:47
|
Update of /cvsroot/pypgsql/pypgsql In directory usw-pr-cvs1:/tmp/cvs-serv12115 Modified Files: pgversion.c Log Message: 12JAN2002 bga [Bug #486151] fixed a problem that prevented a connection to be made to version 7.2devel of PostgreSQL. Index: pgversion.c =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/pgversion.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** pgversion.c 2001/09/19 03:46:49 1.12 --- pgversion.c 2002/01/12 22:38:43 1.13 *************** *** 32,35 **** --- 32,37 ---- | Date Ini Description | | --------- --- ------------------------------------------------------- | + | 12JAN2002 bga [Bug #486151] fixed a problem that prevented a connec- | + | tion to be made to version 7.2devel of PostgreSQL. | | 18SEP2001 bga Removed variables that are no longer needed/referenced. | | 16SEP2001 bga Corrected my mis-conceptions about Python ignoring ex- | *************** *** 105,108 **** --- 107,143 ---- /***********************************************************************\ + | Name: stricmp | + | Synopsis: int stricmp(char *s1, char *s2); | + | Description: stricmp compares its arguments (ignoring case) and re- | + | turns an integer less than, equal to, or greater than | + | 0, based upon whether s1 is lexicographically less | + | than, equal to, or greater than s2. | + | | + | Note: Characters following a null character are not compared. | + \***********************************************************************/ + + static int stricmp(char *s1, char *s2) + { + int c1, c2; + + for (;(*s1 != 0) && (*s2 != 0); s1++, s2++) + { + if (isupper(*s1)) + c1 = _tolower(*s1); + else + c1 = *s1; + if (isupper(*s2)) + c2 = _tolower(*s2); + else + c2 = *s2; + + if (c1 != c2) + break; + } + + return (c1 - c2); + } + + /***********************************************************************\ | Name: parseToken | | | *************** *** 134,137 **** --- 169,175 ---- *result = strtol(token, &last, 0); + + if (stricmp(last, "devel") == 0) + return (errno != 0); return ((errno != 0) || (*last != (char)0)); |
From: Billy G. A. <bal...@us...> - 2001-11-05 02:11:50
|
Update of /cvsroot/pypgsql/ZpyPgSQLDA In directory usw-pr-cvs1:/tmp/cvs-serv23563 Log Message: 04NOV2001 bga Initial import of the ZpyPgSQLDA source tree. Status: Vendor Tag: vendor Release Tags: start N ZpyPgSQLDA/DA.py N ZpyPgSQLDA/db.py N ZpyPgSQLDA/COPYING.ZPL N ZpyPgSQLDA/README N ZpyPgSQLDA/DABase.py N ZpyPgSQLDA/connectionEdit.dtml N ZpyPgSQLDA/connectionAdd.dtml N ZpyPgSQLDA/table_info.dtml N ZpyPgSQLDA/__init__.py N ZpyPgSQLDA/browse.dtml N ZpyPgSQLDA/test/debug.log N ZpyPgSQLDA/test/testDA.py.snippet N ZpyPgSQLDA/test/run.sh N ZpyPgSQLDA/test/testDA.py N ZpyPgSQLDA/icons/field.gif N ZpyPgSQLDA/icons/stable.gif N ZpyPgSQLDA/icons/date.gif N ZpyPgSQLDA/icons/float.gif N ZpyPgSQLDA/icons/what.gif N ZpyPgSQLDA/icons/text.gif N ZpyPgSQLDA/icons/bin.gif N ZpyPgSQLDA/icons/time.gif N ZpyPgSQLDA/icons/int.gif N ZpyPgSQLDA/icons/datetime.gif N ZpyPgSQLDA/icons/table.gif N ZpyPgSQLDA/icons/view.gif No conflicts created by this import ***** Bogus filespec: - Imported sources |