This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: [sqlite3] optimise transaction control functions
Type: enhancement Stage: resolved
Components: Extension Modules Versions: Python 3.11
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: erlendaasland, pablogsal
Priority: low Keywords: patch

Created on 2021-08-28 20:16 by erlendaasland, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 28019 merged erlendaasland, 2021-08-28 20:28
Messages (2)
msg400501 - (view) Author: Erlend E. Aasland (erlendaasland) * (Python triager) Date: 2021-08-28 20:16
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(-)
msg402179 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2021-09-19 22:51
New changeset 771a5467132f0400d4c987db8ba807f845b655bc by Erlend Egeberg Aasland in branch 'main':
bpo-45040: Simplify sqlite3 transaction control functions (GH-28019)
https://github.com/python/cpython/commit/771a5467132f0400d4c987db8ba807f845b655bc
History
Date User Action Args
2022-04-11 14:59:49adminsetgithub: 89203
2021-09-19 22:51:56pablogsalsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-09-19 22:51:40pablogsalsetnosy: + pablogsal
messages: + msg402179
2021-08-28 20:28:35erlendaaslandsetkeywords: + patch
stage: patch review
pull_requests: + pull_request26465
2021-08-28 20:16:36erlendaaslandcreate