summaryrefslogtreecommitdiff
path: root/django/db/backends/mysql/base.py
diff options
context:
space:
mode:
authorMichal Čihař <michal@cihar.com>2018-07-05 18:11:49 +0200
committerTim Graham <timograham@gmail.com>2018-07-05 12:11:49 -0400
commit39e287d8bff50e9f91f3f4471088c1946aa6a76c (patch)
tree9d8ab85997e1d5a57de401a280fa5623a76978ff /django/db/backends/mysql/base.py
parentf1fc7d6b78186171923a9351eb7af3b5b7565156 (diff)
downloaddjango-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.py16
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()