mirror of
https://github.com/django/django.git
synced 2025-09-11 13:06:29 +00:00
Ensured a connection is established when checking the database version.
Fixed a test broken by 21765c0a
. Refs #18135.
This commit is contained in:
parent
9a3988ca5a
commit
ebabd77291
5 changed files with 20 additions and 5 deletions
|
@ -453,7 +453,8 @@ class DatabaseWrapper(BaseDatabaseWrapper):
|
|||
|
||||
@cached_property
|
||||
def mysql_version(self):
|
||||
server_info = self.connection.get_server_info()
|
||||
with self.temporary_connection():
|
||||
server_info = self.connection.get_server_info()
|
||||
match = server_version_re.match(server_info)
|
||||
if not match:
|
||||
raise Exception('Unable to determine MySQL version from version string %r' % server_info)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue