Opened 18 years ago
Closed 18 years ago
#3820 closed (fixed)
DebugCursorWrapper not working on Oracle
Reported by: | 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: | no | UI/UX: | no |
Description
Hello,
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/base.py for the message).
The exhibits itself in /django/branches/boulder-oracle-sprint/django/db/oracle/base.py 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/introspection.py 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()]
Regards
Attachments (1)
Change History (3)
by , 18 years ago
Attachment: | oracle_cursor.patch added |
---|
comment:1 by , 18 years ago
comment:2 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
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!