Opened 9 years ago

Closed 9 years ago

#3820 closed (fixed)

DebugCursorWrapper not working on Oracle

Reported by: Ben Khoo <benk@…> Owned by: jacob
Component: Uncategorized Version: other branch
Severity: Keywords: Oracle DebugCursorWrapper fetchall
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:



I believe there may be an issue with the latest update to the boulder-oracle-sprint branch. A change was made on the 23rd of March so that a DebugCursorWrapper is returned if DEBUG == True. (Refer to the SVN log of /django/branches/boulder-oracle-sprint/django/db/oracle/ for the message).

The exhibits itself in /django/branches/boulder-oracle-sprint/django/db/oracle/ line 288 which reads:

for unresolved_row in cursor:

If DEBUG == True the cursor is a DebugCursorWrapper and is not iterable. Instead I believe that it should read something like the following:

for unresolved_row in cursor.fetchall():

Similarly in the file /django/branches/boulder-oracle-sprint/django/db/oracle/ on line 9, it reads:

return [row[0].upper() for row in cursor]

when I believe it should read

return [row[0].upper() for row in cursor.fetchall()]


Attachments (1)

oracle_cursor.patch (1.2 KB) - added by Ben Khoo <benk@…> 9 years ago.

Download all attachments as: .zip

Change History (3)

Changed 9 years ago by Ben Khoo <benk@…>

comment:1 Changed 9 years ago by bouldersprinters

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

The problem is that some of the Oracle backend code assumed cursors to be iterable and has code like:
for row in cursor:


Supporting .next() and .iter() is actually an optional extension in the python DB-API 2.0. And once this change was made, we discovered the CursorDebugWrapper doesn't support either method. I made a quick fix in the boulder-oracle-sprint branch, and I'll make a more proper fix soon using your patch as a basis (there are a couple other locations this crops up.)

Thank you so much for helping test. We'll get there!

comment:2 Changed 9 years ago by bouldersprinters

  • Resolution set to fixed
  • Status changed from new to closed

(In [4843]) boulder-oracle-sprint: Fixed #3820. See #3835 too, as this is a more
correct fix for the same issue (CursorDebugWrapper not iterable).

Note: See TracTickets for help on using tickets.
Back to Top