You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[sqlite3] drop statement in_use field in favour of sqlite3_stmt_busy() #88239
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:
assignee='https://github.com/erlend-aasland'closed_at=Nonecreated_at=<Date2021-05-08.07:47:59.789>labels= ['extension-modules', 'easy', 'type-feature', '3.11']
title='[sqlite3] drop statement in_use field in favour of sqlite3_stmt_busy()'updated_at=<Date2021-08-19.20:10:44.154>user='https://github.com/erlend-aasland'
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).
Activity
erlend-aasland commentedon May 8, 2021
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:
Con's:
erlend-aasland commentedon May 8, 2021
Modules/_sqlite/statement.c | 14 +-------------
Modules/_sqlite/statement.h | 2 --
4 files changed, 2 insertions(+), 20 deletions(-)
erlend-aasland commentedon Aug 19, 2021
See also gh-89121 (bpo-44958)
gh-88239: Use sqlite3_stmt_busy() to determine if statements are in u…