Repository navigation
[sqlite3] drop statement in_use field in favour of sqlite3_stmt_busy() #88239
Copy link
Copy link
Closed
Labels
3.11only security fixesonly security fixeseasyextension-modulesC modules in the Modules dirC modules in the Modules dirtopic-sqlite3type-featureA feature request or enhancementA feature request or enhancement
Description
Activity
sqlite3_stmt_busy() has been around since SQLite 3.7.10. I suggest to drop the in_use field of pysqlite_Statement in favour of sqlite3_stmt_busy(); we do not need to duplicate functionality already present in SQLite.
There was a bugfix for sqlite3_stmt_busy() in SQLite 3.8.6 regarding rollback statements, but we normally reset all our statements after use, so it should not be a problem. There are some corner cases in _pysqlite_query_execute() where a sqlite3_stmt may not be reset upon return, but that's easily fixable (and it would be a nice side-effect).
Pro's:
- statement objects have one less member
- no duplication of SQLite functionality
- cleaner exit paths from _pysqlite_query_execute()
- less lines of code, easier to maintain
Con's:
- the current code works / "code churn"
- addedextension-modulesC modules in the Modules dirC modules in the Modules dirtype-featureA feature request or enhancementA feature request or enhancement3.11only security fixesonly security fixes
on May 8, 2021 - addedextension-modulesC modules in the Modules dirC modules in the Modules dirtype-featureA feature request or enhancementA feature request or enhancement
on May 8, 2021 $ git diff --stat Modules/_sqlite/connection.c | 1 - Modules/_sqlite/cursor.c | 5 +
Modules/_sqlite/statement.c | 14 +-------------
Modules/_sqlite/statement.h | 2 --
4 files changed, 2 insertions(+), 20 deletions(-)- added a commit that references this issue
on Jun 27, 2022
Metadata
Metadata
Assignees
Labels
3.11only security fixesonly security fixeseasyextension-modulesC modules in the Modules dirC modules in the Modules dirtopic-sqlite3type-featureA feature request or enhancementA feature request or enhancement
Projects
- StatusShow more project fieldsDone
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields: