-
-
Notifications
You must be signed in to change notification settings - Fork 32k
sqlite3.Connection.blobopen() can fail with OverflowError on large rowids #100370
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
Labels
3.11
only security fixes
3.12
only security fixes
topic-sqlite3
type-bug
An unexpected behavior, bug, or error
Comments
Sorry for the late reply. I'm preparing a PR for this; I'll put it up tomorrow. |
1 task
erlend-aasland
added a commit
to erlend-aasland/cpython
that referenced
this issue
Apr 26, 2023
1 task
erlend-aasland
added a commit
to erlend-aasland/cpython
that referenced
this issue
Apr 26, 2023
erlend-aasland
added a commit
that referenced
this issue
May 7, 2023
erlend-aasland
added a commit
to erlend-aasland/cpython
that referenced
this issue
May 8, 2023
…pen for 32-bit builds (python#103902)
erlend-aasland
added a commit
that referenced
this issue
May 8, 2023
jbower-fb
pushed a commit
to jbower-fb/cpython
that referenced
this issue
May 8, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
3.11
only security fixes
3.12
only security fixes
topic-sqlite3
type-bug
An unexpected behavior, bug, or error
Bug report
blobopen
internally usesint
to hold the requested rowid ([1], [2]), but SQLite rowids are actually 64-bit integers:This makes an attempt to open a blob with large rowid raise an
OverflowError
when Python is compiled with 32-bitint
, which is the case on Windows even when compiling as 64-bit application.This might seem like an edge case, but any
INTEGER PRIMARY KEY
in a rowid table aliases rowid, which means any application that uses non-autoincrement primary keys (e.g. timestamps, checksums) is likely to hit this very trivially -- I know I did on basically the first insert. You don't need to have more than 2**32 rows or anything like that for this to happen.100% reproducible with:
Expected: nothing (i.e. successful call)
Instead:
Your environment
Linked PRs
The text was updated successfully, but these errors were encountered: