Update of /cvsroot/pypgsql/pypgsql
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2881
Modified Files:
pgconnection.c
Log Message:
23MAR2005 bga Change code to fix some compatability problems with PostgreSQL 8.x.
Index: pgconnection.c
===================================================================
RCS file: /cvsroot/pypgsql/pypgsql/pgconnection.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** pgconnection.c 6 Mar 2005 20:00:07 -0000 1.22
--- pgconnection.c 16 May 2005 03:31:03 -0000 1.23
***************
*** 29,32 ****
--- 29,34 ----
| Date Ini Description |
| --------- --- ------------------------------------------------------- |
+ | 23MAR2005 bga Change code to fix some compatability problems with |
+ | PostgreSQL 8.x. |
| 05MAR2005 bga Added missing PQclear() (fixes minor memory leak). |
| [Bug #987719] |
***************
*** 141,145 ****
}
! r = ((r = PQhost(conn)) ? r : "localhost");
self->host = Py_BuildValue("s", r);
self->port = Py_BuildValue("l", strtol(PQport(conn), NULL, 10));
--- 143,149 ----
}
! r = PQhost(conn);
! if (r == NULL || *r == 0)
! r = "localhost";
self->host = Py_BuildValue("s", r);
self->port = Py_BuildValue("l", strtol(PQport(conn), NULL, 10));
***************
*** 148,152 ****
self->tty = Py_BuildValue("s", PQtty(conn));
self->user = Py_BuildValue("s", PQuser(conn));
! self->pass = Py_BuildValue("s", PQpass(conn));
self->bePID = Py_BuildValue("i", PQbackendPID(conn));
self->socket = Py_BuildValue("i", PQsocket(conn));
--- 152,162 ----
self->tty = Py_BuildValue("s", PQtty(conn));
self->user = Py_BuildValue("s", PQuser(conn));
! r = PQpass(conn);
! if (r != NULL && *r == 0) {
! self->pass = Py_None;
! Py_INCREF(Py_None);
! } else {
! self->pass = Py_BuildValue("s", r);
! }
self->bePID = Py_BuildValue("i", PQbackendPID(conn));
self->socket = Py_BuildValue("i", PQsocket(conn));
***************
*** 1190,1194 ****
m = PQerrorMessage(cnx);
! if (*m == (char)0)
{
Py_INCREF(Py_None);
--- 1200,1204 ----
m = PQerrorMessage(cnx);
! if (m != NULL && *m == (char)0)
{
Py_INCREF(Py_None);
|