We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7d35abf commit 3687feaCopy full SHA for 3687fea
Lib/sqlite3/test/dbapi.py
@@ -232,8 +232,14 @@ def test_execute_too_much_sql3(self):
232
def test_execute_too_long_string(self):
233
# The default value of SQLITE_MAX_LENGTH is 1_000_000_000, but it may
234
# be up to 2_147_483_647.
235
+ res = self.cu.execute("pragma compile_options")
236
+ opts = {k: v for k, v in [o[0].split("=") for o in res if "=" in o[0]]}
237
try:
- too_long = " " * 2_147_483_648
238
+ max_length = int(opts['MAX_LENGTH'])
239
+ except (KeyError, TypeError):
240
+ max_length = 1_000_000_000
241
+ try:
242
+ too_long = " " * (max_length + 1)
243
except OverflowError:
244
self.skipTest("Unable to create too large SQL string")
245
regex = "query string is too large"
0 commit comments