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.
This commit is contained in:
parent
92c48a392f
commit
f8bfa80680
1
AUTHORS
1
AUTHORS
|
@ -464,6 +464,7 @@ answer newbie questions, and generally made Django that much better:
|
||||||
Marcin Wróbel
|
Marcin Wróbel
|
||||||
Marc Remolt <m.remolt@webmasters.de>
|
Marc Remolt <m.remolt@webmasters.de>
|
||||||
Marc Tamlyn <marc.tamlyn@gmail.com>
|
Marc Tamlyn <marc.tamlyn@gmail.com>
|
||||||
|
Marc-Aurèle Brothier <ma.brothier@gmail.com>
|
||||||
Marian Andre <django@andre.sk>
|
Marian Andre <django@andre.sk>
|
||||||
Marijn Vriens <marijn@metronomo.cl>
|
Marijn Vriens <marijn@metronomo.cl>
|
||||||
Mario Gonzalez <gonzalemario@gmail.com>
|
Mario Gonzalez <gonzalemario@gmail.com>
|
||||||
|
|
|
@ -369,8 +369,9 @@ class DatabaseWrapper(BaseDatabaseWrapper):
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
def mysql_version(self):
|
def mysql_version(self):
|
||||||
with self.temporary_connection():
|
with self.temporary_connection() as cursor:
|
||||||
server_info = self.connection.get_server_info()
|
cursor.execute('SELECT VERSION()')
|
||||||
|
server_info = cursor.fetchone()[0]
|
||||||
match = server_version_re.match(server_info)
|
match = server_version_re.match(server_info)
|
||||||
if not match:
|
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' % server_info)
|
||||||
|
|
Loading…
Reference in New Issue