[3.11] gh-100370: fix OverflowError in sqlite3.Connection.blobopen for 32-bit builds (#103902) (#104285)

This commit is contained in:
Erlend E. Aasland 2023-05-08 10:41:34 +02:00 committed by GitHub
parent 19abf691fe
commit 681d5028bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 36 additions and 9 deletions

View file

@ -1461,6 +1461,14 @@ class BlobTests(unittest.TestCase):
"Cannot operate on a closed database",
blob.read)
def test_blob_32bit_rowid(self):
# gh-100370: we should not get an OverflowError for 32-bit rowids
with memory_database() as cx:
rowid = 2**32
cx.execute("create table t(t blob)")
cx.execute("insert into t(rowid, t) values (?, zeroblob(1))", (rowid,))
cx.blobopen('t', 't', rowid)
@threading_helper.requires_working_threading()
class ThreadTests(unittest.TestCase):