summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2013-02-18 19:09:54 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2013-02-18 22:12:19 +0100
commit282b2f40cd0aa09815001e178f60c9e71667d847 (patch)
tree62270733c42e90f3e05edea2c6fd0597657aa975
parentaea98e8c5357b15da214af311e8cb74b1503f958 (diff)
Fixed #15119 -- Stopped pinging the MySQL server.
-rw-r--r--django/db/backends/__init__.py5
-rw-r--r--django/db/backends/mysql/base.py9
2 files changed, 1 insertions, 13 deletions
diff --git a/django/db/backends/__init__.py b/django/db/backends/__init__.py
index 7a0a577ef1..6e74c2b460 100644
--- a/django/db/backends/__init__.py
+++ b/django/db/backends/__init__.py
@@ -53,11 +53,8 @@ class BaseDatabaseWrapper(object):
__hash__ = object.__hash__
- def _valid_connection(self):
- return self.connection is not None
-
def _cursor(self):
- if not self._valid_connection():
+ if self.connection is None:
conn_params = self.get_connection_params()
self.connection = self.get_new_connection(conn_params)
self.init_connection_state()
diff --git a/django/db/backends/mysql/base.py b/django/db/backends/mysql/base.py
index 754e876701..5a23dce095 100644
--- a/django/db/backends/mysql/base.py
+++ b/django/db/backends/mysql/base.py
@@ -402,15 +402,6 @@ class DatabaseWrapper(BaseDatabaseWrapper):
self.introspection = DatabaseIntrospection(self)
self.validation = DatabaseValidation(self)
- def _valid_connection(self):
- if self.connection is not None:
- try:
- self.connection.ping()
- return True
- except DatabaseError:
- self.close()
- return False
-
def get_connection_params(self):
kwargs = {
'conv': django_conversions,