From f8bfa806805a87d2cdd677089bd96fbf8400cb95 Mon Sep 17 00:00:00 2001 From: Marc-Aurèle Brothier Date: Thu, 7 Jul 2016 15:13:56 +0200 Subject: Fixed #26868 -- Changed MySQL version detection to use a query. Workaround a bug with MariaDB and MySQL native client not stripping the `5.5.5-` prefix. --- django/db/backends/mysql/base.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'django/db') diff --git a/django/db/backends/mysql/base.py b/django/db/backends/mysql/base.py index 524e90d6eb..94415139cc 100644 --- a/django/db/backends/mysql/base.py +++ b/django/db/backends/mysql/base.py @@ -369,8 +369,9 @@ class DatabaseWrapper(BaseDatabaseWrapper): @cached_property def mysql_version(self): - with self.temporary_connection(): - server_info = self.connection.get_server_info() + with self.temporary_connection() as cursor: + cursor.execute('SELECT VERSION()') + server_info = cursor.fetchone()[0] match = server_version_re.match(server_info) if not match: raise Exception('Unable to determine MySQL version from version string %r' % server_info) -- cgit v1.3