mirror of
https://github.com/django/django.git
synced 2025-10-25 14:46:09 +00:00
[1.3.x] Fixed #18135 -- Close connection used for db version checking
On MySQL when checking the server version, a new connection could be
created but never closed. This could result in open connections on
server startup.
Backport of 4423757c0c.
This commit is contained in:
committed by
Anssi Kääriäinen
parent
e293d82c36
commit
a15d3b58d8
@@ -56,6 +56,14 @@ class OracleChecks(unittest.TestCase):
|
||||
self.assertEqual(connection.connection.encoding, "UTF-8")
|
||||
self.assertEqual(connection.connection.nencoding, "UTF-8")
|
||||
|
||||
class MySQLTests(TestCase):
|
||||
@unittest.skipUnless(connection.vendor == 'mysql',
|
||||
"Test valid only for MySQL")
|
||||
def test_server_version_connections(self):
|
||||
connection.close()
|
||||
connection.get_server_version()
|
||||
self.assertTrue(connection.connection is None)
|
||||
|
||||
class DateQuotingTest(TestCase):
|
||||
|
||||
def test_django_date_trunc(self):
|
||||
|
||||
Reference in New Issue
Block a user