From: Billy G. A. <bal...@us...> - 2003-06-17 01:35:47
|
Update of /cvsroot/pypgsql/pypgsql In directory sc8-pr-cvs1:/tmp/cvs-serv6147 Modified Files: pgconnection.c Log Message: 15JUN2003 bga Applied patch by Laurent Pinchart to correct a problem with lo_import, lo_export, and lo_unlink. Index: pgconnection.c =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/pgconnection.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** pgconnection.c 13 Dec 2002 11:30:11 -0000 1.17 --- pgconnection.c 17 Jun 2003 01:35:45 -0000 1.18 *************** *** 29,32 **** --- 29,34 ---- | Date Ini Description | | --------- --- ------------------------------------------------------- | + | 15JUN2003 bga Applied patch by Laurent Pinchart to correct a problem | + | lo_import, lo_export, lo_unlink. | | 13DEC2002 gh In case PQgetResult returns NULL, let libPQgetResult | | return a Python None, like the docstring says. This is | *************** *** 961,965 **** return (PyObject *)NULL; ! if (!(oid = lo_import(PgConnection_Get(self), filename))) { PyErr_SetString(PqErr_OperationalError, "Can't import large object."); --- 963,967 ---- return (PyObject *)NULL; ! if ((oid = lo_import(PgConnection_Get(self), filename)) < 0) { PyErr_SetString(PqErr_OperationalError, "Can't import large object."); *************** *** 986,990 **** return (PyObject *)NULL; ! if (!(lo_export(PgConnection_Get(self), oid, filename))) { PyErr_SetString(PqErr_OperationalError, "Can't export large object."); --- 988,992 ---- return (PyObject *)NULL; ! if (lo_export(PgConnection_Get(self), oid, filename) < 0) { PyErr_SetString(PqErr_OperationalError, "Can't export large object."); *************** *** 1011,1015 **** return (PyObject *)NULL; ! if (lo_unlink(PgConnection_Get(self), oid)) { PyErr_SetString(PyExc_IOError, "error unlinking large object"); --- 1013,1017 ---- return (PyObject *)NULL; ! if (lo_unlink(PgConnection_Get(self), oid) < 0) { PyErr_SetString(PyExc_IOError, "error unlinking large object"); |