* psycopg/pqpath.c (pq_execute): uncomment the "curs->pgres ==

NULL" error handler after the PQexec() call.  This is needed to
	catch database disconnects (and probably other errors).  According
	to Federico, it was commented out to avoid a spurious error, so we
	should watch for problems.
This commit is contained in:
James Henstridge 2007-12-19 14:33:44 +00:00
parent fd5d2d5238
commit 4910f53b7e
2 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,11 @@
2007-12-20 James Henstridge <james@jamesh.id.au>
* psycopg/pqpath.c (pq_execute): uncomment the "curs->pgres ==
NULL" error handler after the PQexec() call. This is needed to
catch database disconnects (and probably other errors). According
to Federico, it was commented out to avoid a spurious error, so we
should watch for problems.
2007-12-20 James Henstridge <james@jamesh.id.au>
* psycopg/pqpath.c (pq_raise): only remove the first 8 characters

View File

@ -456,14 +456,13 @@ pq_execute(cursorObject *curs, const char *query, int async)
curs->pgres = PQexec(curs->conn->pgconn, query);
/* dont let pgres = NULL go to pq_fetch() */
/* if (curs->pgres == NULL) {
if (curs->pgres == NULL) {
pthread_mutex_unlock(&(curs->conn->lock));
Py_BLOCK_THREADS;
PyErr_SetString(OperationalError,
PQerrorMessage(curs->conn->pgconn));
return -1;
}
*/
}
else if (async == 1) {