1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

[1.4.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:
Michael Newman
2012-05-27 21:51:03 +03:00
committed by Anssi Kääriäinen
parent d3fa8d92ea
commit 0f69a16785
2 changed files with 20 additions and 3 deletions

View File

@@ -65,6 +65,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):