diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-07-23 13:34:06 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-23 13:34:06 +0200 |
| commit | 8d52a525c806ab162efb236e3e93785be9585184 (patch) | |
| tree | f68b80f1b9d93359c58448434b55bdf5a79229c8 | |
| parent | 2ff517ccb6116c1be6338e6bdcf08a313defc5c7 (diff) | |
Refs #29548 -- Fixed DatabaseWrapper.display_name on MariaDB.
| -rw-r--r-- | django/db/backends/mysql/base.py | 5 | ||||
| -rw-r--r-- | django/db/backends/mysql/validation.py | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/django/db/backends/mysql/base.py b/django/db/backends/mysql/base.py index 792eae086f..821f24fdf1 100644 --- a/django/db/backends/mysql/base.py +++ b/django/db/backends/mysql/base.py @@ -97,7 +97,6 @@ class CursorWrapper: class DatabaseWrapper(BaseDatabaseWrapper): vendor = 'mysql' - display_name = 'MySQL' # This dictionary maps Field objects to their associated MySQL column # types, as strings. Column-type strings can contain format strings; they'll # be interpolated against the values of Field.__dict__ before being output. @@ -330,6 +329,10 @@ class DatabaseWrapper(BaseDatabaseWrapper): return True @cached_property + def display_name(self): + return 'MariaDB' if self.mysql_is_mariadb else 'MySQL' + + @cached_property def data_type_check_constraints(self): if self.features.supports_column_check_constraints: return { diff --git a/django/db/backends/mysql/validation.py b/django/db/backends/mysql/validation.py index 5cd9a42856..9def8e57f8 100644 --- a/django/db/backends/mysql/validation.py +++ b/django/db/backends/mysql/validation.py @@ -47,8 +47,8 @@ class DatabaseValidation(BaseDatabaseValidation): if field.db_index and field_type.lower() in self.connection._limited_data_types: errors.append( checks.Warning( - 'MySQL does not support a database index on %s columns.' - % field_type, + '%s does not support a database index on %s columns.' + % (self.connection.display_name, field_type), hint=( "An index won't be created. Silence this warning if " "you don't care about it." |
