Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.10] bpo-42972: Track sqlite3 statement objects (GH-26475) #26515

Merged
merged 2 commits into from Jun 3, 2021

Conversation

@erlend-aasland
Copy link
Contributor

@erlend-aasland erlend-aasland commented Jun 3, 2021

Allocate and track statement objects in pysqlite_statement_create.

By allocating and tracking creation of statement object in
pysqlite_statement_create(), the caller does not need to worry about GC
syncronization, and eliminates the possibility of getting a badly
created object. All related fault handling is moved to
pysqlite_statement_create().

Co-authored-by: Victor Stinner vstinner@python.org.
(cherry picked from commit fffa0f9)

Co-authored-by: Erlend Egeberg Aasland erlend.aasland@innova.no

https://bugs.python.org/issue42972

Allocate and track statement objects in pysqlite_statement_create.

By allocating and tracking creation of statement object in
pysqlite_statement_create(), the caller does not need to worry about GC
syncronization, and eliminates the possibility of getting a badly
created object. All related fault handling is moved to
pysqlite_statement_create().

Co-authored-by: Victor Stinner <vstinner@python.org>.
(cherry picked from commit fffa0f9)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
@vstinner
Copy link
Member

@vstinner vstinner commented Jun 3, 2021

Build fails on Windows:

Error: D:\a\cpython\cpython\Modules\_sqlite\statement.c(117,27): error C2198: '_pysqlite_seterror': too few arguments for call [D:\a\cpython\cpython\PCbuild\_sqlite3.vcxproj]

Copy link
Member

@vstinner vstinner left a comment

LGTM. Backport from main branch.

@vstinner vstinner merged commit 84d80f5 into python:3.10 Jun 3, 2021
13 checks passed
@vstinner
Copy link
Member

@vstinner vstinner commented Jun 3, 2021

I couldn't merge this PR until the CI passed. And I didn't want to use automerge to be able to edit the commit message (to remove the second commit). The commit message of the second commit is ignored if you use git commit --fixup.

@erlend-aasland erlend-aasland deleted the backport-fffa0f9-3.10 branch Jun 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants