bpo-45754: Use correct SQLite limit when checking statement length (GH-29489)

This commit is contained in:
Erlend Egeberg Aasland 2021-11-10 19:46:11 +01:00 committed by GitHub
parent 4cdeee5978
commit c1323d4b8c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 11 deletions

View file

@ -362,11 +362,11 @@ class RegressionTests(unittest.TestCase):
with memory_database() as cx, cx_limit(cx) as lim:
cu = cx.cursor()
cx("select 1".ljust(lim-1))
cx("select 1".ljust(lim))
# use a different SQL statement; don't reuse from the LRU cache
cu.execute("select 2".ljust(lim-1))
cu.execute("select 2".ljust(lim))
sql = "select 3".ljust(lim)
sql = "select 3".ljust(lim+1)
self.assertRaisesRegex(sqlite.DataError, msg, cx, sql)
self.assertRaisesRegex(sqlite.DataError, msg, cu.execute, sql)