diff options
| author | Anssi Kääriäinen <akaariai@gmail.com> | 2013-02-23 00:27:39 +0200 |
|---|---|---|
| committer | Anssi Kääriäinen <akaariai@gmail.com> | 2013-02-23 00:31:14 +0200 |
| commit | 251f345db68278547fae520632765dc229a02a18 (patch) | |
| tree | 05454ff7f2cec4f3e9c33aae6a04a263938721d7 | |
| parent | 8a99d718f7db2d018a37f78a8e5639ff2d1d2aa8 (diff) | |
[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 ce094e570e0ff085b88b2303e25124331f558e45
| -rw-r--r-- | django/db/backends/oracle/base.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/django/db/backends/oracle/base.py b/django/db/backends/oracle/base.py index 5409037d41..4ffe7083b8 100644 --- a/django/db/backends/oracle/base.py +++ b/django/db/backends/oracle/base.py @@ -224,7 +224,8 @@ WHEN (new.%(col_name)s IS NULL) if six.PY3: return cursor.statement else: - 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) |
