Skip to content

Commit d2cf0f4

Browse files
authored
Drop support for MySQL 5.7 and MariaDB 10.3 (#987)
1 parent d1f4af6 commit d2cf0f4

File tree

7 files changed

+17
-19
lines changed

7 files changed

+17
-19
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ jobs:
2525
- '3.10'
2626
- '3.11'
2727
database:
28-
- mysql:5.7
2928
- mysql:8.0
30-
- mariadb:10.3
3129
- mariadb:10.4
3230
- mariadb:10.5
3331
- mariadb:10.6

HISTORY.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
History
33
=======
44

5+
* Drop support for MySQL 5.7 and MariaDB 10.3.
6+
They will both reach EOL this year, and Django 4.2 does not support them.
7+
(No actual functionality has been removed, just testing of these versions.)
8+
59
4.8.0 (2022-12-06)
610
------------------
711

docs/installation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ Python 3.7 to 3.11 supported.
88

99
Django 3.2 to 4.1 supported.
1010

11-
MySQL 5.7 to 8.0 supported.
11+
MySQL 8.0 supported.
1212

13-
MariaDB 10.3 to 10.8 supported.
13+
MariaDB 10.4 to 10.8 supported.
1414

1515
mysqclient 1.3 to 1.4 supported.
1616

docs/queryset_extensions.rst

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,8 @@ Once you’ve done this, the following methods will work.
251251

252252
.. warning::
253253

254-
The query cache is disabled by default in MySQL 5.7.20+ and MariaDB
255-
10.1.7+, and removed in MySQL 8.0+.
254+
The query cache was removed in MySQL 8.0, and is disabled by default
255+
from MariaDB 10.1.7.
256256

257257
Example usage:
258258

@@ -262,7 +262,6 @@ Once you’ve done this, the following methods will work.
262262
recent_posts = BlogPost.objects.sql_cache().order_by("-created")[:5]
263263
264264
Docs:
265-
`MySQL <https://dev.mysql.com/doc/refman/en/select.html>`__ /
266265
`MariaDB
267266
<https://mariadb.com/kb/en/mariadb/select/#sql_cache-sql_no_cache>`__.
268267

@@ -276,8 +275,8 @@ Once you’ve done this, the following methods will work.
276275

277276
.. warning::
278277

279-
The query cache is disabled by default in MySQL 5.7.20+ and MariaDB
280-
10.1.7+, and removed in MySQL 8.0+.
278+
The query cache was removed in MySQL 8.0, and is disabled by default
279+
from MariaDB 10.1.7.
281280

282281
Example usage:
283282

@@ -290,7 +289,6 @@ Once you’ve done this, the following methods will work.
290289
)
291290
292291
Docs:
293-
`MySQL <https://dev.mysql.com/doc/refman/en/select.html>`__ /
294292
`MariaDB
295293
<https://mariadb.com/kb/en/mariadb/select/#sql_cache-sql_no_cache>`__.
296294

tests/db_backend/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
class DatabaseWrapper(BaseDatabaseWrapper):
77
def init_connection_state(self):
8-
if not self.mysql_is_mariadb and self.mysql_version >= (8,):
8+
if not self.mysql_is_mariadb:
99
sql_mode = ",".join(
1010
[
1111
"ERROR_FOR_DIVISION_BY_ZERO",

tests/testapp/test_models.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
from tests.testapp.models import NameAuthorExtra
3232
from tests.testapp.models import VanillaAuthor
3333
from tests.testapp.utils import CaptureLastQuery
34-
from tests.testapp.utils import skip_if_mysql_8_plus
34+
from tests.testapp.utils import skip_if_mysql
3535
from tests.testapp.utils import used_indexes
3636

3737

@@ -180,13 +180,13 @@ def test_disabled_setting_errors_on_usage(self):
180180

181181
assert "DJANGO_MYSQL_REWRITE_QUERIES" in str(excinfo.value)
182182

183-
@skip_if_mysql_8_plus()
183+
@skip_if_mysql()
184184
def test_sql_cache(self):
185185
with CaptureLastQuery() as cap:
186186
list(Author.objects.sql_cache().all())
187187
assert cap.query.startswith("SELECT SQL_CACHE ")
188188

189-
@skip_if_mysql_8_plus()
189+
@skip_if_mysql()
190190
def test_sql_no_cache(self):
191191
with CaptureLastQuery() as cap:
192192
list(Author.objects.sql_no_cache().all())

tests/testapp/utils.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,9 @@ def conn_is_mysql(connection: BaseDatabaseWrapper) -> TypeGuard[MySQLDatabaseWra
2626

2727

2828
@contextmanager
29-
def skip_if_mysql_8_plus() -> Generator[None, None, None]:
30-
if not conn_is_mysql(connection) or (
31-
not connection.mysql_is_mariadb and connection.mysql_version >= (8,)
32-
):
33-
pytest.skip("Requires MySQL<8 or MariaDB")
29+
def skip_if_mysql() -> Generator[None, None, None]:
30+
if not connection.mysql_is_mariadb:
31+
pytest.skip("Requires MariaDB")
3432
yield
3533

3634

0 commit comments

Comments
 (0)