Skip to content

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

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

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 [email protected].
(cherry picked from commit fffa0f9)

Co-authored-by: Erlend Egeberg Aasland [email protected]

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 <[email protected]>.
(cherry picked from commit fffa0f9)

Co-authored-by: Erlend Egeberg Aasland <[email protected]>
@vstinner
Copy link
Member

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Backport from main branch.

@vstinner
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants