summaryrefslogtreecommitdiff
path: root/django/db/backends/__init__.py
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2014-06-08 22:42:12 +0200
committerAymeric Augustin <aymeric.augustin@m4x.org>2014-06-09 21:38:10 +0200
commit40bfd8561d016f6632c95d03e46a720571ad1a8a (patch)
treea56e3a87281529f13b8c6a19d180ab9e9e54f052 /django/db/backends/__init__.py
parent127218b92bb8482fcb8b02457ed9797486ed3a22 (diff)
Fixed #20420 -- Normalized query counts on Oracle.
This is achieved by inserting a fake entry in connection.queries when not releasing a savepoint (since Oracle doesn't support that operation.) Also removed the can_release_savepoints feature that was recently added, but is superseded by this solution.
Diffstat (limited to 'django/db/backends/__init__.py')
-rw-r--r--django/db/backends/__init__.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/django/db/backends/__init__.py b/django/db/backends/__init__.py
index 39628e76fc..f4f2ba2fe0 100644
--- a/django/db/backends/__init__.py
+++ b/django/db/backends/__init__.py
@@ -74,6 +74,10 @@ class BaseDatabaseWrapper(object):
self._thread_ident = thread.get_ident()
@property
+ def queries_logged(self):
+ return self.use_debug_cursor or settings.DEBUG
+
+ @property
def queries(self):
if len(self.queries_log) == self.queries_log.maxlen:
warnings.warn(
@@ -156,7 +160,7 @@ class BaseDatabaseWrapper(object):
Creates a cursor, opening a connection if necessary.
"""
self.validate_thread_sharing()
- if self.use_debug_cursor or settings.DEBUG:
+ if self.queries_logged:
cursor = self.make_debug_cursor(self._cursor())
else:
cursor = self.make_cursor(self._cursor())
@@ -493,7 +497,6 @@ class BaseDatabaseFeatures(object):
can_return_id_from_insert = False
has_bulk_insert = False
uses_savepoints = False
- can_release_savepoints = True
can_combine_inserts_with_and_without_auto_increment_pk = False
# If True, don't use integer foreign keys referring to, e.g., positive