GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-40810: Require SQLite 3.7.15 by erlend-aasland · Pull Request #24106 · python/cpython

bpo-40810: Require SQLite 3.7.15 #24106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
berkerpeksag merged 1 commit into python:master from erlend-aasland:require-sqlite-3.7.15
Jan 6, 2021

Uh oh!

There was an error while loading. Please reload this page.

Merged

bpo-40810: Require SQLite 3.7.15 #24106

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1 commit
Select commit
93372c0
bpo-40810: Require SQLite 3.7.15
May 23, 2020
File filter
Filter by extension


Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

2 changes: 1 addition & 1 deletion 2 Doc/library/sqlite3.rst
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ PostgreSQL or Oracle.

The sqlite3 module was written by Gerhard Häring. It provides a SQL interface
compliant with the DB-API 2.0 specification described by :pep:`249`, and
requires SQLite 3.7.3 or newer.
requires SQLite 3.7.15 or newer.

To use the module, you must first create a :class:`Connection` object that
represents the database. Here the data will be stored in the
Expand Down
5 changes: 2 additions & 3 deletions 5 Doc/whatsnew/3.10.rst
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -577,13 +577,12 @@ CPython bytecode changes
Build Changes
=============


* The C99 functions :c:func:`snprintf` and :c:func:`vsnprintf` are now required
to build Python.
(Contributed by Victor Stinner in :issue:`36020`.)

* :mod:`sqlite3` requires SQLite 3.7.3 or higher.
(Contributed by Sergey Fedoseev and Erlend E. Aasland :issue:`40744`.)
* :mod:`sqlite3` requires SQLite 3.7.15 or higher. (Contributed by Sergey Fedoseev
and Erlend E. Aasland :issue:`40744` and :issue:`40810`.)

* The :mod:`atexit` module must now always be built as a built-in module.
(Contributed by Victor Stinner in :issue:`42639`.)
Expand Down
4 changes: 0 additions & 4 deletions 4 Lib/sqlite3/test/dbapi.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,6 @@ def __fspath__(self):
cx.execute('create table test(id integer)')

def CheckOpenUri(self):
if sqlite.sqlite_version_info < (3, 7, 7):
with self.assertRaises(sqlite.NotSupportedError):
sqlite.connect(':memory:', uri=True)
return
self.addCleanup(unlink, TESTFN)
with sqlite.connect(TESTFN) as cx:
cx.execute('create table test(id integer)')
Expand Down
8 changes: 0 additions & 8 deletions 8 Lib/sqlite3/test/hooks.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -260,14 +260,6 @@ 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
1 change: 1 addition & 0 deletions 1 Misc/NEWS.d/next/Library/2021-01-05-00-52-30.bpo-40810.JxQqPe.rst
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Require SQLite 3.7.15 or newer. Patch by Erlend E. Aasland.
30 changes: 2 additions & 28 deletions 30 Modules/_sqlite/connection.c
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ void pysqlite_connection_dealloc(pysqlite_Connection* self)

/* Clean up if user has not called .close() explicitly. */
if (self->db) {
SQLITE3_CLOSE(self->db);
sqlite3_close_v2(self->db);
}

Py_XDECREF(self->isolation_level);
Expand Down Expand Up @@ -338,7 +338,7 @@ pysqlite_connection_close_impl(pysqlite_Connection *self)
pysqlite_do_all_statements(self, ACTION_FINALIZE, 1);

if (self->db) {
rc = SQLITE3_CLOSE(self->db);
rc = sqlite3_close_v2(self->db);

if (rc != SQLITE_OK) {
_pysqlite_seterror(self->db, NULL);
Expand Down Expand Up @@ -1687,33 +1687,7 @@ pysqlite_connection_backup_impl(pysqlite_Connection *self,
if (rc == SQLITE_NOMEM) {
(void)PyErr_NoMemory();
} else {
#if SQLITE_VERSION_NUMBER > 3007015
PyErr_SetString(pysqlite_OperationalError, sqlite3_errstr(rc));
#else
switch (rc) {
case SQLITE_ERROR:
/* Description of SQLITE_ERROR in SQLite 3.7.14 and older
releases. */
PyErr_SetString(pysqlite_OperationalError,
"SQL logic error or missing database");
break;
case SQLITE_READONLY:
PyErr_SetString(pysqlite_OperationalError,
"attempt to write a readonly database");
break;
case SQLITE_BUSY:
PyErr_SetString(pysqlite_OperationalError, "database is locked");
break;
case SQLITE_LOCKED:
PyErr_SetString(pysqlite_OperationalError,
"database table is locked");
break;
default:
PyErr_Format(pysqlite_OperationalError,
"unrecognized error code: %d", rc);
break;
}
#endif
}
}

Expand Down
8 changes: 4 additions & 4 deletions 8 Modules/_sqlite/module.c
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
#include "microprotocols.h"
#include "row.h"

#if SQLITE_VERSION_NUMBER < 3007003
#error "SQLite 3.7.3 or higher required"
#if SQLITE_VERSION_NUMBER < 3007015
#error "SQLite 3.7.15 or higher required"
#endif

#include "clinic/module.c.h"
Expand Down Expand Up @@ -365,8 +365,8 @@ PyMODINIT_FUNC PyInit__sqlite3(void)
{
PyObject *module;

if (sqlite3_libversion_number() < 3007003) {
PyErr_SetString(PyExc_ImportError, MODULE_NAME ": SQLite 3.7.3 or higher required");
if (sqlite3_libversion_number() < 3007015) {
PyErr_SetString(PyExc_ImportError, MODULE_NAME ": SQLite 3.7.15 or higher required");
return NULL;
}

Expand Down
6 changes: 0 additions & 6 deletions 6 Modules/_sqlite/util.h
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,4 @@ int _pysqlite_seterror(sqlite3* db, sqlite3_stmt* st);

sqlite_int64 _pysqlite_long_as_int64(PyObject * value);

#if SQLITE_VERSION_NUMBER >= 3007014
#define SQLITE3_CLOSE sqlite3_close_v2
#else
#define SQLITE3_CLOSE sqlite3_close
#endif

#endif
3 changes: 1 addition & 2 deletions 3 setup.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -1444,8 +1444,7 @@ def detect_sqlite(self):
]
if CROSS_COMPILING:
sqlite_inc_paths = []
# We need to find >= sqlite version 3.7.3, for sqlite3_create_function_v2()
MIN_SQLITE_VERSION_NUMBER = (3, 7, 3)
MIN_SQLITE_VERSION_NUMBER = (3, 7, 15) # Issue 40810
MIN_SQLITE_VERSION = ".".join([str(x)
for x in MIN_SQLITE_VERSION_NUMBER])

Expand Down
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.