summaryrefslogtreecommitdiff
path: root/django/db/backends/mysql/features.py
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2022-07-08 13:30:12 +0200
committerGitHub <noreply@github.com>2022-07-08 13:30:12 +0200
commiteb3699ea775548a22e0407ad12bf8cbdeaf95ff5 (patch)
treebed4fed56dfc92b6808de048d1c2b6132d064ed4 /django/db/backends/mysql/features.py
parentccbf714ebeff51d1370789e5e487a978d0e2dbfb (diff)
downloaddjango-eb3699ea775548a22e0407ad12bf8cbdeaf95ff5.tar.gz
Fixed #33718 -- Dropped support for MySQL 5.7.
Diffstat (limited to 'django/db/backends/mysql/features.py')
-rw-r--r--django/db/backends/mysql/features.py56
1 files changed, 3 insertions, 53 deletions
diff --git a/django/db/backends/mysql/features.py b/django/db/backends/mysql/features.py
index b454618646..db04d42e24 100644
--- a/django/db/backends/mysql/features.py
+++ b/django/db/backends/mysql/features.py
@@ -61,15 +61,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
if self.connection.mysql_is_mariadb:
return (10, 4)
else:
- return (5, 7)
-
- @cached_property
- def bare_select_suffix(self):
- if not self.connection.mysql_is_mariadb and self.connection.mysql_version < (
- 8,
- ):
- return " FROM DUAL"
- return ""
+ return (8,)
@cached_property
def test_collations(self):
@@ -128,27 +120,6 @@ class DatabaseFeatures(BaseDatabaseFeatures):
},
}
)
- if not self.connection.mysql_is_mariadb and self.connection.mysql_version < (
- 8,
- ):
- skips.update(
- {
- "Casting to datetime/time is not supported by MySQL < 8.0. "
- "(#30224)": {
- "aggregation.tests.AggregateTestCase."
- "test_aggregation_default_using_time_from_python",
- "aggregation.tests.AggregateTestCase."
- "test_aggregation_default_using_datetime_from_python",
- },
- "MySQL < 8.0 returns string type instead of datetime/time. "
- "(#30224)": {
- "aggregation.tests.AggregateTestCase."
- "test_aggregation_default_using_time_from_database",
- "aggregation.tests.AggregateTestCase."
- "test_aggregation_default_using_datetime_from_database",
- },
- }
- )
if self.connection.mysql_is_mariadb and (
10,
4,
@@ -175,21 +146,6 @@ class DatabaseFeatures(BaseDatabaseFeatures):
},
}
)
- if not self.connection.mysql_is_mariadb and self.connection.mysql_version < (
- 8,
- ):
- skips.update(
- {
- "Parenthesized combined queries are not supported on MySQL < 8.": {
- "queries.test_qs_combinators.QuerySetSetOperationTests."
- "test_union_in_subquery",
- "queries.test_qs_combinators.QuerySetSetOperationTests."
- "test_union_in_subquery_related_outerref",
- "queries.test_qs_combinators.QuerySetSetOperationTests."
- "test_union_in_with_ordering",
- }
- }
- )
if not self.supports_explain_analyze:
skips.update(
{
@@ -342,16 +298,10 @@ class DatabaseFeatures(BaseDatabaseFeatures):
return not self.connection.mysql_is_mariadb
@cached_property
- def supports_json_field(self):
- if self.connection.mysql_is_mariadb:
- return True
- return self.connection.mysql_version >= (5, 7, 8)
-
- @cached_property
def can_introspect_json_field(self):
if self.connection.mysql_is_mariadb:
- return self.supports_json_field and self.can_introspect_check_constraints
- return self.supports_json_field
+ return self.can_introspect_check_constraints
+ return True
@cached_property
def supports_index_column_ordering(self):