Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Fixed #20010 -- Make sure `last_executed_query` contains it's associa…

…ted parameters on Oracle.

Also removed some unused imports.
  • Loading branch information...
commit bc7a10299f7ad7f468fa78d5990b7b545d4d599d 1 parent 1b12e24
@charettes charettes authored
Showing with 7 additions and 10 deletions.
  1. +7 −10 django/db/backends/oracle/
17 django/db/backends/oracle/
@@ -5,7 +5,6 @@
from __future__ import unicode_literals
-import datetime
import decimal
import re
import sys
@@ -45,16 +44,13 @@ def _setup_environment(environ):
from django.core.exceptions import ImproperlyConfigured
raise ImproperlyConfigured("Error loading cx_Oracle module: %s" % e)
-from django.conf import settings
from django.db import utils
from django.db.backends import *
from import DatabaseClient
from import DatabaseCreation
from import DatabaseIntrospection
from django.utils.encoding import force_bytes, force_text
-from django.utils.functional import cached_property
-from django.utils import six
-from django.utils import timezone
DatabaseError = Database.DatabaseError
IntegrityError = Database.IntegrityError
@@ -267,11 +263,12 @@ def field_cast_sql(self, db_type):
def last_executed_query(self, cursor, sql, params):
# The DB API definition does not define this attribute.
- if six.PY3:
- return cursor.statement
- else:
- query = cursor.statement
- return query if isinstance(query, unicode) else query.decode("utf-8")
+ statement = cursor.statement
+ if not six.PY3 and not isinstance(statement, unicode):
+ statement = statement.decode('utf-8')
+ # Unlike Psycopg's `query` and MySQLdb`'s `_last_executed`, CxOracle's
+ # `statement` doesn't contain the query parameters. refs #20010.
+ return super(DatabaseOperations, self).last_executed_query(cursor, statement, params)
def last_insert_id(self, cursor, table_name, pk_name):
sq_name = self._get_sequence_name(table_name)

0 comments on commit bc7a102

Please sign in to comment.
Something went wrong with that request. Please try again.