diff options
author | Michal Čihař <michal@cihar.com> | 2018-07-05 18:11:49 +0200 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2018-07-05 12:11:49 -0400 |
commit | 39e287d8bff50e9f91f3f4471088c1946aa6a76c (patch) | |
tree | 9d8ab85997e1d5a57de401a280fa5623a76978ff /django/db/backends/mysql/base.py | |
parent | f1fc7d6b78186171923a9351eb7af3b5b7565156 (diff) | |
download | django-39e287d8bff50e9f91f3f4471088c1946aa6a76c.tar.gz |
Fixed #29544 -- Fixed regex lookup on MariaDB.
Regression in 42490768441701bc02255b22df8e6894cbe487c7.
Diffstat (limited to 'django/db/backends/mysql/base.py')
-rw-r--r-- | django/db/backends/mysql/base.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/django/db/backends/mysql/base.py b/django/db/backends/mysql/base.py index 91e0e83242..fcc6a91c47 100644 --- a/django/db/backends/mysql/base.py +++ b/django/db/backends/mysql/base.py @@ -326,11 +326,19 @@ class DatabaseWrapper(BaseDatabaseWrapper): return True @cached_property - def mysql_version(self): + def mysql_server_info(self): with self.temporary_connection() as cursor: cursor.execute('SELECT VERSION()') - server_info = cursor.fetchone()[0] - match = server_version_re.match(server_info) + return cursor.fetchone()[0] + + @cached_property + def mysql_version(self): + match = server_version_re.match(self.mysql_server_info) if not match: - raise Exception('Unable to determine MySQL version from version string %r' % server_info) + raise Exception('Unable to determine MySQL version from version string %r' % self.mysql_server_info) return tuple(int(x) for x in match.groups()) + + @cached_property + def mysql_is_mariadb(self): + # MariaDB isn't officially supported. + return 'mariadb' in self.mysql_server_info.lower() |