From bb6432525ca2c34b9dbafd5f476db121b3dd559d Mon Sep 17 00:00:00 2001 From: Erlend Egeberg Aasland Date: Tue, 5 Jan 2021 00:16:43 +0100 Subject: [PATCH] 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 f7f0ed59bcc41ed20674d4b2aa443d3b79e725f4) Co-authored-by: Erlend Egeberg Aasland --- Lib/sqlite3/test/hooks.py | 8 ++++++++ .../next/Tests/2020-05-30-10-56-38.bpo-40810.LPqDLQ.rst | 1 + 2 files changed, 9 insertions(+) create mode 100644 Misc/NEWS.d/next/Tests/2020-05-30-10-56-38.bpo-40810.LPqDLQ.rst diff --git a/Lib/sqlite3/test/hooks.py b/Lib/sqlite3/test/hooks.py index d74e74bf272275..214205c1167a41 100644 --- a/Lib/sqlite3/test/hooks.py +++ b/Lib/sqlite3/test/hooks.py @@ -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) 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 00000000000000..1965ecd6ef511f --- /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. pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy