Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-89121: Keep the number of pending SQLite statements to a minimum #30379

Merged
merged 8 commits into from
Jun 23, 2022
Prev Previous commit
Next Next commit
Reset in iternext on error path
  • Loading branch information
erlend-aasland committed Jun 20, 2022
commit 12bb96e071e7877a43557e0c02ff6aa5514ab3ae
2 changes: 2 additions & 0 deletions Modules/_sqlite/cursor.c
Original file line number Diff line number Diff line change
Expand Up @@ -1124,6 +1124,8 @@ pysqlite_cursor_iternext(pysqlite_Cursor *self)
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;
}
Expand Down