Fixed #33713 -- Dropped support for MariaDB 10.3.
This commit is contained in:
parent
2cec020f5b
commit
19297de2fe
|
@ -52,17 +52,14 @@ class DatabaseFeatures(BaseDatabaseFeatures):
|
||||||
@cached_property
|
@cached_property
|
||||||
def minimum_database_version(self):
|
def minimum_database_version(self):
|
||||||
if self.connection.mysql_is_mariadb:
|
if self.connection.mysql_is_mariadb:
|
||||||
return (10, 3)
|
return (10, 4)
|
||||||
else:
|
else:
|
||||||
return (5, 7)
|
return (5, 7)
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
def bare_select_suffix(self):
|
def bare_select_suffix(self):
|
||||||
if (
|
if not self.connection.mysql_is_mariadb and self.connection.mysql_version < (
|
||||||
self.connection.mysql_is_mariadb and self.connection.mysql_version < (10, 4)
|
8,
|
||||||
) or (
|
|
||||||
not self.connection.mysql_is_mariadb
|
|
||||||
and self.connection.mysql_version < (8,)
|
|
||||||
):
|
):
|
||||||
return " FROM DUAL"
|
return " FROM DUAL"
|
||||||
return ""
|
return ""
|
||||||
|
@ -254,8 +251,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
|
||||||
@cached_property
|
@cached_property
|
||||||
def can_introspect_check_constraints(self):
|
def can_introspect_check_constraints(self):
|
||||||
if self.connection.mysql_is_mariadb:
|
if self.connection.mysql_is_mariadb:
|
||||||
version = self.connection.mysql_version
|
return True
|
||||||
return version >= (10, 3, 10)
|
|
||||||
return self.connection.mysql_version >= (8, 0, 16)
|
return self.connection.mysql_version >= (8, 0, 16)
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
|
|
|
@ -441,7 +441,6 @@ class DatabaseOperations(BaseDatabaseOperations):
|
||||||
def on_conflict_suffix_sql(self, fields, on_conflict, update_fields, unique_fields):
|
def on_conflict_suffix_sql(self, fields, on_conflict, update_fields, unique_fields):
|
||||||
if on_conflict == OnConflict.UPDATE:
|
if on_conflict == OnConflict.UPDATE:
|
||||||
conflict_suffix_sql = "ON DUPLICATE KEY UPDATE %(fields)s"
|
conflict_suffix_sql = "ON DUPLICATE KEY UPDATE %(fields)s"
|
||||||
field_sql = "%(field)s = VALUES(%(field)s)"
|
|
||||||
# The use of VALUES() is deprecated in MySQL 8.0.20+. Instead, use
|
# The use of VALUES() is deprecated in MySQL 8.0.20+. Instead, use
|
||||||
# aliases for the new row and its columns available in MySQL
|
# aliases for the new row and its columns available in MySQL
|
||||||
# 8.0.19+.
|
# 8.0.19+.
|
||||||
|
@ -449,8 +448,10 @@ class DatabaseOperations(BaseDatabaseOperations):
|
||||||
if self.connection.mysql_version >= (8, 0, 19):
|
if self.connection.mysql_version >= (8, 0, 19):
|
||||||
conflict_suffix_sql = f"AS new {conflict_suffix_sql}"
|
conflict_suffix_sql = f"AS new {conflict_suffix_sql}"
|
||||||
field_sql = "%(field)s = new.%(field)s"
|
field_sql = "%(field)s = new.%(field)s"
|
||||||
# VALUES() was renamed to VALUE() in MariaDB 10.3.3+.
|
else:
|
||||||
elif self.connection.mysql_version >= (10, 3, 3):
|
field_sql = "%(field)s = VALUES(%(field)s)"
|
||||||
|
# Use VALUE() on MariaDB.
|
||||||
|
else:
|
||||||
field_sql = "%(field)s = VALUE(%(field)s)"
|
field_sql = "%(field)s = VALUE(%(field)s)"
|
||||||
|
|
||||||
fields = ", ".join(
|
fields = ", ".join(
|
||||||
|
|
|
@ -339,7 +339,7 @@ non-durable <https://www.postgresql.org/docs/current/non-durability.html>`_.
|
||||||
MariaDB notes
|
MariaDB notes
|
||||||
=============
|
=============
|
||||||
|
|
||||||
Django supports MariaDB 10.3 and higher.
|
Django supports MariaDB 10.4 and higher.
|
||||||
|
|
||||||
To use MariaDB, use the MySQL backend, which is shared between the two. See the
|
To use MariaDB, use the MySQL backend, which is shared between the two. See the
|
||||||
:ref:`MySQL notes <mysql-notes>` for more details.
|
:ref:`MySQL notes <mysql-notes>` for more details.
|
||||||
|
|
|
@ -223,6 +223,12 @@ backends.
|
||||||
|
|
||||||
* ...
|
* ...
|
||||||
|
|
||||||
|
Dropped support for MariaDB 10.3
|
||||||
|
--------------------------------
|
||||||
|
|
||||||
|
Upstream support for MariaDB 10.3 ends in May 2023. Django 4.2 supports MariaDB
|
||||||
|
10.4 and higher.
|
||||||
|
|
||||||
Miscellaneous
|
Miscellaneous
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
|
|
|
@ -107,8 +107,8 @@ class Tests(TestCase):
|
||||||
@mock.patch.object(connection, "get_database_version")
|
@mock.patch.object(connection, "get_database_version")
|
||||||
def test_check_database_version_supported(self, mocked_get_database_version):
|
def test_check_database_version_supported(self, mocked_get_database_version):
|
||||||
if connection.mysql_is_mariadb:
|
if connection.mysql_is_mariadb:
|
||||||
mocked_get_database_version.return_value = (10, 2)
|
mocked_get_database_version.return_value = (10, 3)
|
||||||
msg = "MariaDB 10.3 or later is required (found 10.2)."
|
msg = "MariaDB 10.4 or later is required (found 10.3)."
|
||||||
else:
|
else:
|
||||||
mocked_get_database_version.return_value = (5, 6)
|
mocked_get_database_version.return_value = (5, 6)
|
||||||
msg = "MySQL 5.7 or later is required (found 5.6)."
|
msg = "MySQL 5.7 or later is required (found 5.6)."
|
||||||
|
|
Loading…
Reference in New Issue