[New-bugs-announce] [issue44073] [sqlite3] drop statement in_use field in favour of sqlite3_stmt_busy()

Erlend E. Aasland report at bugs.python.org
Sat May 8 03:47:59 EDT 2021


New submission from Erlend E. Aasland <erlend.aasland at innova.no>:

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"

----------
assignee: erlendaasland
components: Extension Modules
keywords: easy (C)
messages: 393241
nosy: berker.peksag, erlendaasland, serhiy.storchaka
priority: normal
severity: normal
status: open
title: [sqlite3] drop statement in_use field in favour of sqlite3_stmt_busy()
type: enhancement
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44073>
_______________________________________


More information about the New-bugs-announce mailing list