aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_sqlite3/test_dbapi.py
diff options
context:
space:
mode:
authorErlend E. Aasland <erlend.aasland@protonmail.com>2023-05-07 12:55:31 +0200
committerGitHub <noreply@github.com>2023-05-07 12:55:31 +0200
commita05bad3254e2ae5fdf558dfdb65899a2298d8ded (patch)
tree68baa25ee85b65327963610ecc5674815b17613f /Lib/test/test_sqlite3/test_dbapi.py
parentcab1298a6022ddf12ddcdadd74bb8741650d8e9f (diff)
downloadcpython-a05bad3254e2ae5fdf558dfdb65899a2298d8ded.tar.gz
cpython-a05bad3254e2ae5fdf558dfdb65899a2298d8ded.zip
gh-100370: fix OverflowError in sqlite3.Connection.blobopen for 32-bit builds (#103902)
Diffstat (limited to 'Lib/test/test_sqlite3/test_dbapi.py')
-rw-r--r--Lib/test/test_sqlite3/test_dbapi.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_sqlite3/test_dbapi.py b/Lib/test/test_sqlite3/test_dbapi.py
index 1bb0e13e356..328b0467e7f 100644
--- a/Lib/test/test_sqlite3/test_dbapi.py
+++ b/Lib/test/test_sqlite3/test_dbapi.py
@@ -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):