Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Simplify test
SQLite seems to have slightly inconsisten behaviour when it comes to
enforcing limits. It might have something to do with the SQLite compile
time options, or it may be a bug. Simplifying the test seems to work
in different environments.
  • Loading branch information
erlend-aasland committed May 2, 2022
commit e58797ca60fa6dce18e9c2e660210a39194c3c61
7 changes: 3 additions & 4 deletions Lib/test/test_sqlite3/test_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,12 +326,11 @@ def test_trace_too_much_expanded_sql(self):
# unexpanded SQL statement (for SQLite 3.14.0 and newer).
# The resulting string length is limited by the runtime limit
# SQLITE_LIMIT_LENGTH.
template = "select 'b' as \"a\" from sqlite_master where \"a\"="
template = "select 1 as a where a="
category = sqlite.SQLITE_LIMIT_LENGTH
with memory_database() as cx, cx_limit(cx, category=category) as lim:
nextra = lim - (len(template) + 2) - 1
ok_param = "a" * nextra
bad_param = "a" * (nextra + 1)
ok_param = "a"
bad_param = "a" * lim

unexpanded_query = template + "?"
expected = [unexpanded_query]
Expand Down