From 280562890b0bc424148a0247a49c3f666417233b Mon Sep 17 00:00:00 2001 From: Federico Di Gregorio Date: Mon, 20 Dec 2004 02:32:08 +0000 Subject: [PATCH] rowcount fix. --- ChangeLog | 6 ++++++ MANIFEST.in | 2 +- psycopg/pqpath.c | 7 +------ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 38fdefa6..6cb537a2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-12-20 Federico Di Gregorio + + * psycopg/pqpath.c (pq_execute): removed multiple calls to + pq_fetch in syncronous DBAPI compatibility mode to solve rowcount + problem. + 2004-12-14 Federico Di Gregorio * Mm.. release 1.99.11. diff --git a/MANIFEST.in b/MANIFEST.in index 62bc8e9f..f24d1389 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,7 +2,7 @@ recursive-include psycopg *.c *.h recursive-include lib *.py recursive-include ZPsycopgDA *.py *.gif *.dtml recursive-include examples *.py somehackers.jpg whereareyou.jpg -#recursive-include test *.py +#recursive-include tests *.py recursive-include doc TODO HACKING SUCCESS ChangeLog-1.x include scripts/maketypes.sh scripts/buildtypes.py include AUTHORS README INSTALL ChangeLog setup.py setup.cfg diff --git a/psycopg/pqpath.c b/psycopg/pqpath.c index ea344005..30e13f36 100644 --- a/psycopg/pqpath.c +++ b/psycopg/pqpath.c @@ -353,8 +353,6 @@ pq_is_busy(connectionObject *conn) int pq_execute(cursorObject *curs, const char *query, int async) { - int err; - /* if the status of the connection is critical raise an exception and definitely close the connection */ if (curs->conn->critical) { @@ -410,10 +408,7 @@ pq_execute(cursorObject *curs, const char *query, int async) to respect the old DBAPI-2.0 compatible behaviour */ if (async == 0) { Dprintf("pq_execute: entering syncronous DBAPI compatibility mode"); - do { - err = pq_fetch(curs); - if (err == -1) return -1; - } while (err == 1); + if (pq_fetch(curs) == -1) return -1; } else { curs->conn->async_cursor = (PyObject*)curs;