Browse files

[1.5.x] Fixed Oracle regression in last_executed_query() with unicode…

… strings

The regression was likely caused by the fix in #19606 which adjusted
Oracle's unicode detection, though it seems this would have been an
issue in some configurations even before.

Backpatch of ce094e5
  • Loading branch information...
1 parent 8a99d71 commit 251f345db68278547fae520632765dc229a02a18 @akaariai akaariai committed Feb 22, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 django/db/backends/oracle/
@@ -224,7 +224,8 @@ def last_executed_query(self, cursor, sql, params):
if six.PY3:
return cursor.statement
- return cursor.statement.decode("utf-8")
+ query = cursor.statement
+ return query if isinstance(query, unicode) else query.decode("utf-8")
def last_insert_id(self, cursor, table_name, pk_name):
sq_name = self._get_sequence_name(table_name)

0 comments on commit 251f345

Please sign in to comment.