summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_sqlite3/test_dbapi.py
diff options
context:
space:
mode:
authorErlend E. Aasland <erlend.aasland@protonmail.com>2023-05-08 08:41:34 (GMT)
committerGitHub <noreply@github.com>2023-05-08 08:41:34 (GMT)
commit681d5028bda41fb0755da443cea6be24bd2a0fdd (patch)
tree4f04f862432c94017423027424aeb633c4922f28 /Lib/test/test_sqlite3/test_dbapi.py
parent19abf691fe1d59a58882c09e9624fb1ffb910e57 (diff)
downloadcpython-681d5028bda41fb0755da443cea6be24bd2a0fdd.zip
cpython-681d5028bda41fb0755da443cea6be24bd2a0fdd.tar.gz
cpython-681d5028bda41fb0755da443cea6be24bd2a0fdd.tar.bz2
[3.11] gh-100370: fix OverflowError in sqlite3.Connection.blobopen for 32-bit builds (#103902) (#104285)
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 9d94ddd..899f5cf 100644
--- a/Lib/test/test_sqlite3/test_dbapi.py
+++ b/Lib/test/test_sqlite3/test_dbapi.py
@@ -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):