From: <da...@br...> - 2002-12-20 05:53:41
|
Update of /home/cvs/libdbi/drivers/postgresql In directory backbeat:/tmp/cvs-serv4304/drivers/postgresql Modified Files: dbd_pgsql.c Log Message: fixed and enhanced error handling when dbi_conn_connect failed Index: dbd_pgsql.c =================================================================== RCS file: /home/cvs/libdbi/drivers/postgresql/dbd_pgsql.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- dbd_pgsql.c 3 Dec 2002 08:25:32 -0000 1.24 +++ dbd_pgsql.c 20 Dec 2002 05:53:07 -0000 1.25 @@ -110,12 +110,15 @@ if (!pgconn) return -1; if (PQstatus(pgconn) == CONNECTION_BAD) { - _error_handler(conn, DBI_ERROR_DBD); /* grab any more specific error information from postgresql first */ + conn->connection = (void *)pgconn; // still need this set so _error_handler can grab information + _error_handler(conn, DBI_ERROR_DBD); PQfinish(pgconn); + conn->connection = NULL; // pgconn no longer valid return -2; } else { conn->connection = (void *)pgconn; + // XXX no conn->current_db assignment here like the mysql driver. investigate. } return 0; |