diff options
author | Bruce Momjian <bruce@momjian.us> | 2001-08-16 15:21:16 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2001-08-16 15:21:16 +0000 |
commit | f7eedfdff248a9ee6d403ba7e70c43ff09d9057e (patch) | |
tree | 795b7a49ed106ce0961521cd0551e407becdfa2b /src/interfaces/python/pgmodule.c | |
parent | 1e59edd2989f67fe4b2d7cd776fea0bb435dc5cc (diff) | |
download | postgresql-f7eedfdff248a9ee6d403ba7e70c43ff09d9057e.tar.gz postgresql-f7eedfdff248a9ee6d403ba7e70c43ff09d9057e.zip |
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
Diffstat (limited to 'src/interfaces/python/pgmodule.c')
-rw-r--r-- | src/interfaces/python/pgmodule.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/interfaces/python/pgmodule.c b/src/interfaces/python/pgmodule.c index 98da3646363..38ae733b9a4 100644 --- a/src/interfaces/python/pgmodule.c +++ b/src/interfaces/python/pgmodule.c @@ -548,13 +548,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); } |