Kaydet (Commit) 27193aea authored tarafından Tim Graham's avatar Tim Graham Kaydeden (comit) GitHub

Fixed #28584 -- Dropped support for SQLite < 3.7.15.

üst 51d230e0
......@@ -2,8 +2,6 @@ from django.db import utils
from django.db.backends.base.features import BaseDatabaseFeatures
from django.utils.functional import cached_property
from .base import Database
class DatabaseFeatures(BaseDatabaseFeatures):
# SQLite cannot handle us only partially reading from a cursor's result set
......@@ -30,13 +28,9 @@ class DatabaseFeatures(BaseDatabaseFeatures):
supports_temporal_subtraction = True
ignores_table_name_case = True
supports_cast_with_precision = False
uses_savepoints = Database.sqlite_version_info >= (3, 6, 8)
supports_index_column_ordering = Database.sqlite_version_info >= (3, 3, 0)
can_release_savepoints = uses_savepoints
can_share_in_memory_db = (
Database.__name__ == 'sqlite3.dbapi2' and
Database.sqlite_version_info >= (3, 7, 13)
)
uses_savepoints = True
can_release_savepoints = True
can_share_in_memory_db = True
@cached_property
def supports_stddev(self):
......
......@@ -87,21 +87,6 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
pk_col = self.get_primary_key_column(cursor, table_name)
return [{'table': table_name, 'column': pk_col}]
def column_name_converter(self, name):
"""
SQLite will in some cases, e.g. when returning columns from views and
subselects, return column names in 'alias."column"' format instead of
simply 'column'.
Affects SQLite < 3.7.15, fixed by http://www.sqlite.org/src/info/5526e0aa3c
"""
# TODO: remove when SQLite < 3.7.15 is sufficiently old.
# 3.7.13 ships in Debian stable as of 2014-03-21.
if self.connection.Database.sqlite_version_info < (3, 7, 15):
return name.split('.')[-1].strip('"')
else:
return name
def get_relations(self, cursor, table_name):
"""
Return a dictionary of {field_name: (field_name_other_table, other_table)}
......
......@@ -61,7 +61,7 @@ Database Library Requirements Supported Versions Notes
PostgreSQL GEOS, GDAL, PROJ.4, PostGIS 9.4+ Requires PostGIS.
MySQL GEOS, GDAL 5.6+ Not OGC-compliant; :ref:`limited functionality <mysql-spatial-limitations>`.
Oracle GEOS, GDAL 12.1+ XE not supported.
SQLite GEOS, GDAL, PROJ.4, SpatiaLite 3.6.+ Requires SpatiaLite 4.1+
SQLite GEOS, GDAL, PROJ.4, SpatiaLite 3.7.15+ Requires SpatiaLite 4.1+
================== ============================== ================== =========================================
See also `this comparison matrix`__ on the OSGeo Wiki for
......
......@@ -40,12 +40,6 @@ For example ``Index(fields=['headline', '-pub_date'])`` would create SQL with
``(headline, pub_date DESC)``. Index ordering isn't supported on MySQL. In that
case, a descending index is created as a normal index.
.. admonition:: Support for column ordering on SQLite
Column ordering is supported on SQLite 3.3.0+ and only for some database
file formats. Refer to the `SQLite docs
<https://www.sqlite.org/lang_createindex.html>`_ for specifics.
``name``
--------
......
......@@ -487,9 +487,9 @@ Savepoints
A savepoint is a marker within a transaction that enables you to roll back
part of a transaction, rather than the full transaction. Savepoints are
available with the SQLite (≥ 3.6.8), PostgreSQL, Oracle and MySQL (when using
the InnoDB storage engine) backends. Other backends provide the savepoint
functions, but they're empty operations -- they don't actually do anything.
available with the SQLite, PostgreSQL, Oracle, and MySQL (when using the InnoDB
storage engine) backends. Other backends provide the savepoint functions, but
they're empty operations -- they don't actually do anything.
Savepoints aren't especially useful if you are using autocommit, the default
behavior of Django. However, once you open a transaction with :func:`atomic`,
......@@ -582,8 +582,8 @@ Database-specific notes
Savepoints in SQLite
--------------------
While SQLite ≥ 3.6.8 supports savepoints, a flaw in the design of the
:mod:`sqlite3` module makes them hardly usable.
While SQLite supports savepoints, a flaw in the design of the :mod:`sqlite3`
module makes them hardly usable.
When autocommit is enabled, savepoints don't make sense. When it's disabled,
:mod:`sqlite3` commits implicitly before savepoint statements. (In fact, it
......
......@@ -177,7 +177,7 @@ control the particular collation used by the test database. See the
:doc:`settings documentation </ref/settings>` for details of these
and other advanced settings.
If using an SQLite in-memory database with SQLite 3.7.13+, `shared cache
If using an SQLite in-memory database with SQLite, `shared cache
<https://www.sqlite.org/sharedcache.html>`_ is enabled, so you can write tests
with ability to share the database between threads.
......
......@@ -5,7 +5,7 @@ from operator import attrgetter, itemgetter
from uuid import UUID
from django.core.exceptions import FieldError
from django.db import connection, models
from django.db import models
from django.db.models import F, Max, Min, Q, Sum, Value
from django.db.models.expressions import Case, When
from django.test import TestCase
......@@ -296,12 +296,6 @@ class CaseExpressionTests(TestCase):
transform=attrgetter('integer', 'test')
)
if connection.vendor == 'sqlite' and connection.Database.sqlite_version_info < (3, 7, 0):
# There is a bug in sqlite < 3.7.0, where placeholder order is lost.
# Thus, the above query returns <condition_value> + <result_value>
# for each matching case instead of <result_value> + 1 (#24148).
test_combined_expression = unittest.expectedFailure(test_combined_expression)
def test_in_subquery(self):
self.assertQuerysetEqual(
CaseTestModel.objects.filter(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment