summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnssi Kääriäinen <akaariai@gmail.com>2012-06-13 14:13:56 +0300
committerAnssi Kääriäinen <akaariai@gmail.com>2012-06-13 14:16:34 +0300
commit86c20e39eb9ea0bbd25889403d16d857748aff9b (patch)
tree0857a42383a2bac1dddd8c744840522bcd614b4a
parente9ef9776d186a3379cdbf47a73b14e89b74d0926 (diff)
Fixed connection.queries encoding handling on Oracle
In addition, removed a possibly problematic .filter() call from backends.test_query_encoding test. It is possible the .filter could cause collation problems on MySQL, and as it wasn't absolutely needed for the test it seemed better to get rid of the call. Refs #18461.
-rw-r--r--django/db/backends/oracle/base.py2
-rw-r--r--tests/regressiontests/backends/tests.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/django/db/backends/oracle/base.py b/django/db/backends/oracle/base.py
index 785e4b72a6..64e038e1a6 100644
--- a/django/db/backends/oracle/base.py
+++ b/django/db/backends/oracle/base.py
@@ -212,7 +212,7 @@ WHEN (new.%(col_name)s IS NULL)
def last_executed_query(self, cursor, sql, params):
# http://cx-oracle.sourceforge.net/html/cursor.html#Cursor.statement
# The DB API definition does not define this attribute.
- return cursor.statement
+ return cursor.statement.decode("utf-8")
def last_insert_id(self, cursor, table_name, pk_name):
sq_name = self._get_sequence_name(table_name)
diff --git a/tests/regressiontests/backends/tests.py b/tests/regressiontests/backends/tests.py
index cf6b964070..cf4242d62c 100644
--- a/tests/regressiontests/backends/tests.py
+++ b/tests/regressiontests/backends/tests.py
@@ -154,7 +154,7 @@ class LastExecutedQueryTest(TestCase):
"""
Test that last_executed_query() returns an Unicode string
"""
- tags = models.Tag.objects.filter(name="й", object_id=12).extra(select={'föö':1})
+ tags = models.Tag.objects.extra(select={'föö':1})
sql, params = tags.query.sql_with_params()
cursor = tags.query.get_compiler('default').execute_sql(None)
last_sql = cursor.db.ops.last_executed_query(cursor, sql, params)