mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
gh-94028: Clear and reset sqlite3 statements properly in cursor iternext (GH-94042)
(cherry picked from commit 94eeac03dc
)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
This commit is contained in:
parent
2733c64e28
commit
b4ebde429e
3 changed files with 45 additions and 0 deletions
|
@ -1129,10 +1129,13 @@ pysqlite_cursor_iternext(pysqlite_Cursor *self)
|
|||
self->rowcount = (long)sqlite3_changes(self->connection->db);
|
||||
}
|
||||
(void)stmt_reset(self->statement);
|
||||
Py_CLEAR(self->statement);
|
||||
}
|
||||
else if (rc != SQLITE_ROW) {
|
||||
(void)_pysqlite_seterror(self->connection->state,
|
||||
self->connection->db);
|
||||
(void)stmt_reset(self->statement);
|
||||
Py_CLEAR(self->statement);
|
||||
Py_DECREF(row);
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue