From f7f0ed59bcc41ed20674d4b2aa443d3b79e725f4 Mon Sep 17 00:00:00 2001 From: Erlend Egeberg Aasland Date: Tue, 5 Jan 2021 00:16:43 +0100 Subject: bpo-40810: Fix CheckTraceCallbackContent for SQLite pre 3.7.15 (GH-20530) Ref. [SQLite 3.7.15 changelog](https://sqlite.org/changes.html#version_3_7_15): _"Avoid invoking the sqlite3_trace() callback multiple times when a statement is automatically reprepared due to SQLITE_SCHEMA errors."_ --- Lib/sqlite3/test/hooks.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Lib/sqlite3') 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) -- cgit v1.2.1