Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8b97a09

Browse files
committed
This patch fixes the well-known but unfixed bug that fetchone() always
returns the first result in the DB-API compliant wrapper. It turned outthat the bug was way down in the C code.Gerhard Häring
1 parentc43d241 commit8b97a09

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎src/interfaces/python/pgmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,13 +554,13 @@ pgsource_fetch(pgsourceobject * self, PyObject * args)
554554

555555
for (j=0;j<self->num_fields;j++)
556556
{
557-
if (PQgetisnull(self->last_result,i,j))
557+
if (PQgetisnull(self->last_result,self->current_row,j))
558558
{
559559
Py_INCREF(Py_None);
560560
str=Py_None;
561561
}
562562
else
563-
str=PyString_FromString(PQgetvalue(self->last_result,i,j));
563+
str=PyString_FromString(PQgetvalue(self->last_result,self->current_row,j));
564564

565565
PyTuple_SET_ITEM(rowtuple,j,str);
566566
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp