summaryrefslogtreecommitdiff
path: root/django/db/backends/mysql/features.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/db/backends/mysql/features.py')
-rw-r--r--django/db/backends/mysql/features.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/django/db/backends/mysql/features.py b/django/db/backends/mysql/features.py
index db04d42e24..2d5487446e 100644
--- a/django/db/backends/mysql/features.py
+++ b/django/db/backends/mysql/features.py
@@ -66,11 +66,14 @@ class DatabaseFeatures(BaseDatabaseFeatures):
@cached_property
def test_collations(self):
charset = "utf8"
- if self.connection.mysql_is_mariadb and self.connection.mysql_version >= (
- 10,
- 6,
+ if (
+ self.connection.mysql_is_mariadb
+ and self.connection.mysql_version >= (10, 6)
+ ) or (
+ not self.connection.mysql_is_mariadb
+ and self.connection.mysql_version >= (8, 0, 30)
):
- # utf8 is an alias for utf8mb3 in MariaDB 10.6+.
+ # utf8 is an alias for utf8mb3 in MariaDB 10.6+ and MySQL 8.0.30+.
charset = "utf8mb3"
return {
"ci": f"{charset}_general_ci",