Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions django/db/backends/mysql/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
@cached_property
def minimum_database_version(self):
if self.connection.mysql_is_mariadb:
return (10, 6)
return (10, 11)
else:
return (8, 4)

Expand Down Expand Up @@ -207,8 +207,6 @@ def can_introspect_json_field(self):
def supports_index_column_ordering(self):
if self._mysql_storage_engine != "InnoDB":
return False
if self.connection.mysql_is_mariadb:
return self.connection.mysql_version >= (10, 8)
return True

@cached_property
Expand All @@ -220,8 +218,7 @@ def supports_expression_indexes(self):

@cached_property
def has_native_uuid_field(self):
is_mariadb = self.connection.mysql_is_mariadb
return is_mariadb and self.connection.mysql_version >= (10, 7)
return self.connection.mysql_is_mariadb

@cached_property
def allows_group_by_selected_pks(self):
Expand Down
2 changes: 1 addition & 1 deletion docs/ref/databases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ non-durable <https://www.postgresql.org/docs/current/non-durability.html>`_.
MariaDB notes
=============

Django supports MariaDB 10.6 and higher.
Django supports MariaDB 10.11 and higher.

To use MariaDB, use the MySQL backend, which is shared between the two. See the
:ref:`MySQL notes <mysql-notes>` for more details.
Expand Down
10 changes: 5 additions & 5 deletions docs/ref/models/fields.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1649,8 +1649,8 @@ Like all :class:`CharField` subclasses, :class:`URLField` takes the optional
.. class:: UUIDField(**options)

A field for storing universally unique identifiers. Uses Python's
:class:`~python:uuid.UUID` class. When used on PostgreSQL and MariaDB 10.7+,
this stores in a ``uuid`` datatype, otherwise in a ``char(32)``.
:class:`~python:uuid.UUID` class. When used on PostgreSQL and MariaDB, this
stores in a ``uuid`` datatype, otherwise in a ``char(32)``.

Universally unique identifiers are a good alternative to :class:`AutoField` for
:attr:`~Field.primary_key`. The database will not generate the UUID for you, so
Expand All @@ -1667,13 +1667,13 @@ it is recommended to use :attr:`~Field.default`::
Note that a callable (with the parentheses omitted) is passed to ``default``,
not an instance of ``UUID``.

.. admonition:: Lookups on PostgreSQL and MariaDB 10.7+
.. admonition:: Lookups on PostgreSQL and MariaDB

Using :lookup:`iexact`, :lookup:`contains`, :lookup:`icontains`,
:lookup:`startswith`, :lookup:`istartswith`, :lookup:`endswith`, or
:lookup:`iendswith` lookups on PostgreSQL don't work for values without
hyphens, because PostgreSQL and MariaDB 10.7+ store them in a hyphenated
uuid datatype type.
hyphens, because PostgreSQL and MariaDB store them in a hyphenated uuid
datatype type.

.. _relationship-fields:

Expand Down
5 changes: 0 additions & 5 deletions docs/ref/models/indexes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,6 @@ field's name.
For example ``Index(fields=['headline', '-pub_date'])`` would create SQL with
``(headline, pub_date DESC)``.

.. admonition:: MariaDB

Index ordering isn't supported on MariaDB < 10.8. In that case, a
descending index is created as a normal index.

``name``
--------

Expand Down
7 changes: 3 additions & 4 deletions docs/ref/models/querysets.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1988,10 +1988,9 @@ them:
<QuerySet [<Person: ...>, ...]>

The ``postgresql``, ``oracle``, and ``mysql`` database backends support
``select_for_update()``. However, MariaDB only supports the ``nowait``
argument, MariaDB 10.6+ also supports the ``skip_locked`` argument, and MySQL
supports the ``nowait``, ``skip_locked``, and ``of`` arguments. The ``no_key``
argument is only supported on PostgreSQL.
``select_for_update()``. However, MariaDB only supports the ``nowait`` and
``skip_locked`` arguments, and MySQL supports the ``nowait``, ``skip_locked``,
and ``of`` arguments. The ``no_key`` argument is only supported on PostgreSQL.

Passing ``nowait=True``, ``skip_locked=True``, ``no_key=True``, or ``of`` to
``select_for_update()`` using database backends that do not support these
Expand Down
6 changes: 6 additions & 0 deletions docs/releases/6.1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,12 @@ Dropped support for MySQL < 8.4
Upstream support for MySQL 8.0 ends in April 2026, and MySQL 8.1-8.3 are
short-term innovation releases. Django 6.1 supports MySQL 8.4 and higher.

Dropped support for MariaDB < 10.11
-----------------------------------

Upstream support for MariaDB 10.6 ends in July 2026, and MariaDB 10.7-10.10 are
short-term maintenance releases. Django 6.1 supports MariaDB 10.11 and higher.

Miscellaneous
-------------

Expand Down
4 changes: 2 additions & 2 deletions tests/backends/mysql/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ class Tests(TestCase):
@mock.patch.object(connection, "get_database_version")
def test_check_database_version_supported(self, mocked_get_database_version):
if connection.mysql_is_mariadb:
mocked_get_database_version.return_value = (10, 5)
msg = "MariaDB 10.6 or later is required (found 10.5)."
mocked_get_database_version.return_value = (10, 10)
msg = "MariaDB 10.11 or later is required (found 10.10)."
else:
mocked_get_database_version.return_value = (8, 0, 31)
msg = "MySQL 8.4 or later is required (found 8.0.31)."
Expand Down