summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Lib/sqlite3/test/hooks.py8
-rw-r--r--Misc/NEWS.d/next/Tests/2020-05-30-10-56-38.bpo-40810.LPqDLQ.rst1
2 files changed, 9 insertions, 0 deletions
diff --git a/Lib/sqlite3/test/hooks.py b/Lib/sqlite3/test/hooks.py
index 2e620ecdf8..6c1aaa2d60 100644
--- a/Lib/sqlite3/test/hooks.py
+++ b/Lib/sqlite3/test/hooks.py
@@ -260,6 +260,14 @@ class TraceCallbackTests(unittest.TestCase):
cur.execute(queries[0])
con2.execute("create table bar(x)")
cur.execute(queries[1])
+
+ # Extract from SQLite 3.7.15 changelog:
+ # Avoid invoking the sqlite3_trace() callback multiple times when a
+ # statement is automatically reprepared due to SQLITE_SCHEMA errors.
+ #
+ # See bpo-40810
+ if sqlite.sqlite_version_info < (3, 7, 15):
+ queries.append(queries[-1])
self.assertEqual(traced_statements, queries)
diff --git a/Misc/NEWS.d/next/Tests/2020-05-30-10-56-38.bpo-40810.LPqDLQ.rst b/Misc/NEWS.d/next/Tests/2020-05-30-10-56-38.bpo-40810.LPqDLQ.rst
new file mode 100644
index 0000000000..1965ecd6ef
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2020-05-30-10-56-38.bpo-40810.LPqDLQ.rst
@@ -0,0 +1 @@
+In :mod:`sqlite3`, fix `CheckTraceCallbackContent` for SQLite pre 3.7.15.