Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f4e1810

Browse files
committed
Fix TraceCallbackTests to not use bound parameters (followup to issue #11688)
1 parent fc2e376 commit f4e1810

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Lib/sqlite3/test/hooks.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,10 @@ def trace(statement):
213213
traced_statements.append(statement)
214214
con.set_trace_callback(trace)
215215
con.execute("create table foo(x)")
216-
con.execute("insert into foo(x) values (?)", (unicode_value,))
216+
# Can't execute bound parameters as their values don't appear
217+
# in traced statements before SQLite 3.6.21
218+
# (cf. http://www.sqlite.org/draft/releaselog/3_6_21.html)
219+
con.execute('insert into foo(x) values ("%s")' % unicode_value)
217220
con.commit()
218221
self.assertTrue(any(unicode_value in stmt for stmt in traced_statements),
219222
"Unicode data %s garbled in trace callback: %s"

0 commit comments

Comments
 (0)