gh-92206: Improve scoping of sqlite3 reset statement helper (#92241)

This commit is contained in:
Erlend Egeberg Aasland 2022-05-03 11:48:24 -06:00 committed by GitHub
parent d5dfcd4489
commit 415944379f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 30 deletions

View file

@ -366,25 +366,6 @@ pysqlite_statement_bind_parameters(pysqlite_state *state,
}
}
int pysqlite_statement_reset(pysqlite_Statement* self)
{
int rc;
rc = SQLITE_OK;
if (self->in_use && self->st) {
Py_BEGIN_ALLOW_THREADS
rc = sqlite3_reset(self->st);
Py_END_ALLOW_THREADS
if (rc == SQLITE_OK) {
self->in_use = 0;
}
}
return rc;
}
void pysqlite_statement_mark_dirty(pysqlite_Statement* self)
{
self->in_use = 1;