[New-bugs-announce] [issue45040] [sqlite3] optimise transaction control functions

Erlend E. Aasland report at bugs.python.org
Sat Aug 28 16:16:36 EDT 2021


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

pysqlite_connection_commit_impl(), pysqlite_connection_rollback_impl(), and begin_transaction() can be simplified:

sqlite3_finalize() will pass on any error set by sqlite3_step(). This implies that we only need to check the return value of sqlite3_prepare_v2() and sqlite3_finalize(), which implies that we can execute sqlite3_prepare_v2(), sqlite3_step() and sqlite3_finalize() in a row inside a begin/end threads wrapper. As a result, error handling will be greatly simplified.

Fewer lines of code, simpler error paths, increased readability, and increased code coverage.

diffstat: 2 files changed, 27 insertions(+), 62 deletions(-)

----------
components: Extension Modules
messages: 400501
nosy: erlendaasland
priority: low
severity: normal
status: open
title: [sqlite3] optimise transaction control functions
type: enhancement
versions: Python 3.11

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


More information about the New-bugs-announce mailing list