mirror of
https://github.com/AdaCore/cpython.git
synced 2026-02-12 12:57:15 -08:00
Issue #19437: Fix pysqlite_cursor_iternext() of sqlite3, when the row factory
fails, don't consume the row (restore it) and fail immediatly (don't call pysqlite_step())
This commit is contained in:
@@ -871,10 +871,15 @@ PyObject* pysqlite_cursor_iternext(pysqlite_Cursor *self)
|
||||
}
|
||||
|
||||
next_row_tuple = self->next_row;
|
||||
assert(next_row_tuple != NULL);
|
||||
self->next_row = NULL;
|
||||
|
||||
if (self->row_factory != Py_None) {
|
||||
next_row = PyObject_CallFunction(self->row_factory, "OO", self, next_row_tuple);
|
||||
if (next_row == NULL) {
|
||||
self->next_row = next_row_tuple;
|
||||
return NULL;
|
||||
}
|
||||
Py_DECREF(next_row_tuple);
|
||||
} else {
|
||||
next_row = next_row_tuple;
|
||||
|
||||
Reference in New Issue
Block a user