summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian2001-08-16 15:21:53 +0000
committerBruce Momjian2001-08-16 15:21:53 +0000
commit8b97a098e164e1d1dae04c953618e8cb66431f9b (patch)
treeb90228a028512829d83bca5da331f7d3ab4279a8
parentc43d241891844e94316e913b89b30d00594ec4b6 (diff)
This patch fixes the well-known but unfixed bug that fetchone() always
returns the first result in the DB-API compliant wrapper. It turned out that the bug was way down in the C code. Gerhard Häring
-rw-r--r--src/interfaces/python/pgmodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/interfaces/python/pgmodule.c b/src/interfaces/python/pgmodule.c
index a1ce3cd33fe..d1a4907189f 100644
--- a/src/interfaces/python/pgmodule.c
+++ b/src/interfaces/python/pgmodule.c
@@ -554,13 +554,13 @@ pgsource_fetch(pgsourceobject * self, PyObject * args)
for (j = 0; j < self->num_fields; j++)
{
- if (PQgetisnull(self->last_result, i, j))
+ if (PQgetisnull(self->last_result, self->current_row, j))
{
Py_INCREF(Py_None);
str = Py_None;
}
else
- str = PyString_FromString(PQgetvalue(self->last_result, i, j));
+ str = PyString_FromString(PQgetvalue(self->last_result, self->current_row, j));
PyTuple_SET_ITEM(rowtuple, j, str);
}