This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: sqlite3 test CheckTraceCallbackContent fails for sqlite v3.7.3 through 3.7.14.1
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.10, Python 3.9, Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: berker.peksag, brandtbucher, cheryl.sabella, christian.heimes, corona10, erlendaasland, gvanrossum, miss-islington
Priority: normal Keywords: patch

Created on 2020-05-28 17:47 by erlendaasland, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 20330 erlendaasland, 2020-05-29 06:46
PR 20530 merged erlendaasland, 2020-05-30 07:11
PR 24104 merged miss-islington, 2021-01-04 23:17
PR 24105 merged miss-islington, 2021-01-04 23:17
PR 24106 merged erlendaasland, 2021-01-04 23:31
PR 24110 merged brandtbucher, 2021-01-05 06:38
PR 24111 merged miss-islington, 2021-01-05 06:57
PR 24112 merged miss-islington, 2021-01-05 06:57
PR 14491 cheryl.sabella, 2021-01-05 07:24
Messages (15)
msg370256 - (view) Author: Erlend E. Aasland (erlendaasland) * (Python triager) Date: 2020-05-28 17:47
`CheckTraceCallbackContent()` in `Lib/sqlite3/test/hooks.py` fails for SQLite versions 3.7.3 through 3.7.14.1, apparently because of an SQLite bug that was fixed in 3.7.15 (2012-12-12). Extract from the changelog https://sqlite.org/changes.html:
```
Avoid invoking the sqlite3_trace() callback multiple times when a statement is automatically reprepared due to SQLITE_SCHEMA errors.
```

Either we fix tests for SQLite < 3.7.15, or we drop support for SQLite < 3.7.15. (I'm +1 for the latter.)

NB: Versions pre 3.7.3 does not build at all, because of `sqlite3_create_function_v2()`. See bpo-40744 and GH-20330.
msg370263 - (view) Author: Erlend E. Aasland (erlendaasland) * (Python triager) Date: 2020-05-28 19:31
Also related to bpo-26187
msg370264 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2020-05-28 20:02
Could you please check https://distrowatch.com/ and verify that all major Linux distributions have a sufficient version of sqlite. Please also check LTS like Debian oldstable, Ubuntu, and CentOS.
msg370266 - (view) Author: Erlend E. Aasland (erlendaasland) * (Python triager) Date: 2020-05-28 20:38
Debian oldstable (jessie) has sqlite 3.8.7.1
Ubuntu 14.04 LTS (trusty) has sqlite 3.8.2
CentOS 7 and 8 has sqlite versions > 3.7.15

The following distributions include sqlite version _less than_ 3.7.15:
• Porteus (release v2.1 and older)
• OLPC OS
• HardenedBSD
• 0Linux / FreePBX (release v10 and older)
• ToOpPy Linux
• Baruwa Enterprise Edition

The other hits were inactive distros.

https://distrowatch.com/search.php?pkg=sqlite&relation=less&pkgver=3.7.15&distrorange=InLatest#pkgsearch
msg370271 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2020-05-28 22:47
+1 for dropping support for < 3.7.15 in master. We should fix or skip tests in maintenance branches.
msg370278 - (view) Author: Erlend E. Aasland (erlendaasland) * (Python triager) Date: 2020-05-29 05:41
All right, will do, Berker Persag.
msg370304 - (view) Author: Erlend E. Aasland (erlendaasland) * (Python triager) Date: 2020-05-29 12:26
FYI, the #if in line 1563 in `Modules/_sqlite/connection.c` is wrong, but the comment five lines below is correct:
https://github.com/python/cpython/blob/e56ce3ce865cb5539cdedbeae54eaa11ec563922/Modules/_sqlite/connection.c#L1563-L1589

`sqlite3_errstr()` was introduced in 3.7.15, so the #if comparison operator should have been '>=', not '>'.
msg384355 - (view) Author: miss-islington (miss-islington) Date: 2021-01-04 23:16
New changeset f7f0ed59bcc41ed20674d4b2aa443d3b79e725f4 by Erlend Egeberg Aasland in branch 'master':
bpo-40810: Fix CheckTraceCallbackContent for SQLite pre 3.7.15 (GH-20530)
https://github.com/python/cpython/commit/f7f0ed59bcc41ed20674d4b2aa443d3b79e725f4
msg384356 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2021-01-04 23:18
Please ping this issue if the backports don't auto-merge after the tests pass, or if the tests fail.
msg384357 - (view) Author: Erlend E. Aasland (erlendaasland) * (Python triager) Date: 2021-01-04 23:33
> +1 for dropping support for < 3.7.15 in master. We should fix or skip tests in maintenance branches.

PR's for fixing the tests in 3.9 and 3.8 are now awaiting merge. PR for dropping support for SQLite pre 3.7.15 in master is opened.
msg384358 - (view) Author: miss-islington (miss-islington) Date: 2021-01-04 23:36
New changeset 0ccac5ff587d7637854e5d3e75f0f9a8f5528e59 by Miss Islington (bot) in branch '3.8':
bpo-40810: Fix CheckTraceCallbackContent for SQLite pre 3.7.15 (GH-20530)
https://github.com/python/cpython/commit/0ccac5ff587d7637854e5d3e75f0f9a8f5528e59
msg384359 - (view) Author: miss-islington (miss-islington) Date: 2021-01-04 23:41
New changeset 80e5732d31bb7362c7b647acc618df701b3ae951 by Miss Islington (bot) in branch '3.9':
bpo-40810: Fix CheckTraceCallbackContent for SQLite pre 3.7.15 (GH-20530)
https://github.com/python/cpython/commit/80e5732d31bb7362c7b647acc618df701b3ae951
msg384369 - (view) Author: Brandt Bucher (brandtbucher) * (Python committer) Date: 2021-01-05 06:39
It looks like the markup in the NEWS entry broke Travis on master. I guess that's one downside of Travis not being a required job anymore.
msg384445 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2021-01-06 00:02
New changeset cf0b23908cc902ac38cd83dd7ca5afdf89e1543b by Erlend Egeberg Aasland in branch 'master':
bpo-40810: Require SQLite 3.7.15 (GH-24106)
https://github.com/python/cpython/commit/cf0b23908cc902ac38cd83dd7ca5afdf89e1543b
msg384446 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2021-01-06 00:04
I think this is now done. Thank you, Erlend!
History
Date User Action Args
2022-04-11 14:59:31adminsetgithub: 84987
2021-01-06 00:05:08berker.peksagsetversions: - Python 3.7
2021-01-06 00:04:50berker.peksagsetstatus: open -> closed
resolution: fixed
messages: + msg384446

stage: patch review -> resolved
2021-01-06 00:02:50berker.peksagsetmessages: + msg384445
2021-01-05 07:24:40cheryl.sabellasetnosy: + cheryl.sabella
pull_requests: + pull_request22942
2021-01-05 06:57:43miss-islingtonsetpull_requests: + pull_request22941
2021-01-05 06:57:25miss-islingtonsetpull_requests: + pull_request22940
2021-01-05 06:39:56brandtbuchersetmessages: + msg384369
2021-01-05 06:38:39brandtbuchersetnosy: + brandtbucher
pull_requests: + pull_request22939
2021-01-04 23:41:18miss-islingtonsetmessages: + msg384359
2021-01-04 23:36:45miss-islingtonsetmessages: + msg384358
2021-01-04 23:33:39erlendaaslandsetmessages: + msg384357
2021-01-04 23:31:39erlendaaslandsetpull_requests: + pull_request22935
2021-01-04 23:18:26gvanrossumsetnosy: + gvanrossum
messages: + msg384356
2021-01-04 23:17:22miss-islingtonsetpull_requests: + pull_request22934
2021-01-04 23:17:10miss-islingtonsetpull_requests: + pull_request22933
2021-01-04 23:16:47miss-islingtonsetnosy: + miss-islington
messages: + msg384355
2020-12-28 17:07:08corona10setnosy: + corona10
2020-05-30 10:52:09erlendaaslandsetversions: + Python 3.7
2020-05-30 07:11:48erlendaaslandsetpull_requests: + pull_request19774
2020-05-29 12:26:54erlendaaslandsetmessages: + msg370304
2020-05-29 06:46:11erlendaaslandsetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request19753
2020-05-29 05:41:50erlendaaslandsetmessages: + msg370278
2020-05-28 22:47:25berker.peksagsettype: enhancement
messages: + msg370271
stage: needs patch
2020-05-28 20:38:07erlendaaslandsetmessages: + msg370266
2020-05-28 20:02:30christian.heimessetnosy: + christian.heimes
messages: + msg370264
2020-05-28 19:31:04erlendaaslandsetmessages: + msg370263
2020-05-28 19:29:31erlendaaslandsetnosy: + berker.peksag
2020-05-28 17:47:38erlendaaslandcreate