classification
Title: sqlite3 test CheckTraceCallbackContent fails for sqlite v3.7.3 through 3.7.14.1
Type: enhancement Stage: patch review
Components: Library (Lib) Versions: Python 3.10, Python 3.9, Python 3.8, Python 3.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: berker.peksag, christian.heimes, erlendaasland
Priority: normal Keywords: patch

Created on 2020-05-28 17:47 by erlendaasland, last changed 2020-05-30 10:52 by erlendaasland.

Pull Requests
URL Status Linked Edit
PR 20330 erlendaasland, 2020-05-29 06:46
PR 20530 open erlendaasland, 2020-05-30 07:11
Messages (7)
msg370256 - (view) Author: Erlend Egeberg Aasland (erlendaasland) * 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 Egeberg Aasland (erlendaasland) * 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 Egeberg Aasland (erlendaasland) * 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 Egeberg Aasland (erlendaasland) * Date: 2020-05-29 05:41
All right, will do, Berker Persag.
msg370304 - (view) Author: Erlend Egeberg Aasland (erlendaasland) * 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 '>'.
History
Date User Action Args
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