Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcf0b239

Browse files
author
Erlend Egeberg Aasland
authored
bpo-40810: Require SQLite 3.7.15 (GH-24106)
1 parentc7f8d3c commitcf0b239

File tree

9 files changed

+11
-56
lines changed

9 files changed

+11
-56
lines changed

‎Doc/library/sqlite3.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ PostgreSQL or Oracle.
1919

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

2424
To use the module, you must first create a:class:`Connection` object that
2525
represents the database. Here the data will be stored in the

‎Doc/whatsnew/3.10.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -577,13 +577,12 @@ CPython bytecode changes
577577
Build Changes
578578
=============
579579

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

585-
*:mod:`sqlite3` requires SQLite 3.7.3 or higher.
586-
(Contributed by Sergey Fedoseevand Erlend E. Aasland:issue:`40744`.)
584+
*:mod:`sqlite3` requires SQLite 3.7.15 or higher. (Contributed by Sergey Fedoseev
585+
and Erlend E. Aasland:issue:`40744` and:issue:`40810`.)
587586

588587
* The:mod:`atexit` module must now always be built as a built-in module.
589588
(Contributed by Victor Stinner in:issue:`42639`.)

‎Lib/sqlite3/test/dbapi.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,6 @@ def __fspath__(self):
172172
cx.execute('create table test(id integer)')
173173

174174
defCheckOpenUri(self):
175-
ifsqlite.sqlite_version_info< (3,7,7):
176-
withself.assertRaises(sqlite.NotSupportedError):
177-
sqlite.connect(':memory:',uri=True)
178-
return
179175
self.addCleanup(unlink,TESTFN)
180176
withsqlite.connect(TESTFN)ascx:
181177
cx.execute('create table test(id integer)')

‎Lib/sqlite3/test/hooks.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -260,14 +260,6 @@ def trace(statement):
260260
cur.execute(queries[0])
261261
con2.execute("create table bar(x)")
262262
cur.execute(queries[1])
263-
264-
# Extract from SQLite 3.7.15 changelog:
265-
# Avoid invoking the sqlite3_trace() callback multiple times when a
266-
# statement is automatically reprepared due to SQLITE_SCHEMA errors.
267-
#
268-
# See bpo-40810
269-
ifsqlite.sqlite_version_info< (3,7,15):
270-
queries.append(queries[-1])
271263
self.assertEqual(traced_statements,queries)
272264

273265

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Require SQLite 3.7.15 or newer. Patch by Erlend E. Aasland.

‎Modules/_sqlite/connection.c

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ void pysqlite_connection_dealloc(pysqlite_Connection* self)
233233

234234
/* Clean up if user has not called .close() explicitly. */
235235
if (self->db) {
236-
SQLITE3_CLOSE(self->db);
236+
sqlite3_close_v2(self->db);
237237
}
238238

239239
Py_XDECREF(self->isolation_level);
@@ -338,7 +338,7 @@ pysqlite_connection_close_impl(pysqlite_Connection *self)
338338
pysqlite_do_all_statements(self,ACTION_FINALIZE,1);
339339

340340
if (self->db) {
341-
rc=SQLITE3_CLOSE(self->db);
341+
rc=sqlite3_close_v2(self->db);
342342

343343
if (rc!=SQLITE_OK) {
344344
_pysqlite_seterror(self->db,NULL);
@@ -1687,33 +1687,7 @@ pysqlite_connection_backup_impl(pysqlite_Connection *self,
16871687
if (rc==SQLITE_NOMEM) {
16881688
(void)PyErr_NoMemory();
16891689
}else {
1690-
#ifSQLITE_VERSION_NUMBER>3007015
16911690
PyErr_SetString(pysqlite_OperationalError,sqlite3_errstr(rc));
1692-
#else
1693-
switch (rc) {
1694-
caseSQLITE_ERROR:
1695-
/* Description of SQLITE_ERROR in SQLite 3.7.14 and older
1696-
releases. */
1697-
PyErr_SetString(pysqlite_OperationalError,
1698-
"SQL logic error or missing database");
1699-
break;
1700-
caseSQLITE_READONLY:
1701-
PyErr_SetString(pysqlite_OperationalError,
1702-
"attempt to write a readonly database");
1703-
break;
1704-
caseSQLITE_BUSY:
1705-
PyErr_SetString(pysqlite_OperationalError,"database is locked");
1706-
break;
1707-
caseSQLITE_LOCKED:
1708-
PyErr_SetString(pysqlite_OperationalError,
1709-
"database table is locked");
1710-
break;
1711-
default:
1712-
PyErr_Format(pysqlite_OperationalError,
1713-
"unrecognized error code: %d",rc);
1714-
break;
1715-
}
1716-
#endif
17171691
}
17181692
}
17191693

‎Modules/_sqlite/module.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
#include"microprotocols.h"
3030
#include"row.h"
3131

32-
#ifSQLITE_VERSION_NUMBER<3007003
33-
#error "SQLite 3.7.3 or higher required"
32+
#ifSQLITE_VERSION_NUMBER<3007015
33+
#error "SQLite 3.7.15 or higher required"
3434
#endif
3535

3636
#include"clinic/module.c.h"
@@ -365,8 +365,8 @@ PyMODINIT_FUNC PyInit__sqlite3(void)
365365
{
366366
PyObject*module;
367367

368-
if (sqlite3_libversion_number()<3007003) {
369-
PyErr_SetString(PyExc_ImportError,MODULE_NAME": SQLite 3.7.3 or higher required");
368+
if (sqlite3_libversion_number()<3007015) {
369+
PyErr_SetString(PyExc_ImportError,MODULE_NAME": SQLite 3.7.15 or higher required");
370370
returnNULL;
371371
}
372372

‎Modules/_sqlite/util.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,4 @@ int _pysqlite_seterror(sqlite3* db, sqlite3_stmt* st);
3939

4040
sqlite_int64_pysqlite_long_as_int64(PyObject*value);
4141

42-
#ifSQLITE_VERSION_NUMBER >=3007014
43-
#defineSQLITE3_CLOSE sqlite3_close_v2
44-
#else
45-
#defineSQLITE3_CLOSE sqlite3_close
46-
#endif
47-
4842
#endif

‎setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,8 +1444,7 @@ def detect_sqlite(self):
14441444
]
14451445
ifCROSS_COMPILING:
14461446
sqlite_inc_paths= []
1447-
# We need to find >= sqlite version 3.7.3, for sqlite3_create_function_v2()
1448-
MIN_SQLITE_VERSION_NUMBER= (3,7,3)
1447+
MIN_SQLITE_VERSION_NUMBER= (3,7,15)# Issue 40810
14491448
MIN_SQLITE_VERSION=".".join([str(x)
14501449
forxinMIN_SQLITE_VERSION_NUMBER])
14511450

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp