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

This commit is contained in:
Erlend E. Aasland 2023-05-07 12:55:31 +02:00 committed by GitHub
parent cab1298a60
commit a05bad3254
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 36 additions and 9 deletions

View file

@ -1495,6 +1495,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):