Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
bpo-40810: Fix CheckTraceCallbackContent for SQLite pre 3.7.15 (GH-20530
)

Ref. [SQLite 3.7.15 changelog](https://sqlite.org/changes.htmlGH-version_3_7_15):
_"Avoid invoking the sqlite3_trace() callback multiple times when a statement is automatically reprepared due to SQLITE_SCHEMA errors."_
(cherry picked from commit f7f0ed5)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
  • Loading branch information
Erlend Egeberg Aasland authored and miss-islington committed Jan 4, 2021
commit bb6432525ca2c34b9dbafd5f476db121b3dd559d
8 changes: 8 additions & 0 deletions Lib/sqlite3/test/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,14 @@ def trace(statement):
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)


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
In :mod:`sqlite3`, fix `CheckTraceCallbackContent` for SQLite pre 3.7.15.