Repository navigation
Use sqlite_master for the read-lock schema probe - #769
Closed
Vikram12301 wants to merge 1 commit into
Closed
Vikram12301 wants to merge 1 commit into
Vikram12301 wants to merge 1 commit into
Conversation
The read lock forces SQLite to take a shared lock by selecting from the schema table. The sqlite_schema name only exists from SQLite 3.33.0 on, so older SQLite builds fail every read lock with "no such table: sqlite_schema". sqlite_master is the long-standing name and works on all versions.
gaborbernat
added a commit
that referenced
this pull request
Oct 5, 2026
Use sqlite_master for the read-lock schema probe so SQLite versions older than 3.33.0 can acquire read locks. Include the required changelog fragment. Supersedes #769. Co-authored-by: Vikram M <[email protected]>
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The read lock forces SQLite to take a shared lock by selecting from the schema table. The code uses
sqlite_schema, which only exists from SQLite 3.33.0 on. Older SQLite builds fail every read lock:This changes the name to
sqlite_master, the long-standing name that works on every SQLite version. Nothing else changes.Reproduction
Built SQLite 3.32.3 from the official amalgamation and ran the same statement the read lock issues:
The bug is not platform specific. Any environment that bundles SQLite older than 3.33.0 hits it.
Testing
tox run -e 3.13: 1856 passed, 57 skipped, 100% line and branch coverage, diff-cover reports no missing lines.tox run -e fix: passes.