Opened 17 years ago
Closed 17 years ago
#7036 closed (fixed)
Oracle backend broken on queryset-refactor
Reported by: | Malcolm Tredinnick | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | queryset-refactor |
Severity: | Keywords: | qs-rf | |
Cc: | Erin Kelly | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Noting this here in case anybody is trying to use queryset-refactor and Oracle...
At some point in the recent past, I've managed to completely break Oracle backend. Ian Kelly reports a whole bunch of failures when running the test suite that look like
File "/home/ikelly/projects/django.qs-rf/django/db/models/query.py", line 156, in iterator obj = self.model(*row[index_start:]) File "/home/ikelly/projects/django.qs-rf/django/db/models/base.py", line 205, in __init__ raise IndexError("Number of args exceeds number of fields") IndexError: Number of args exceeds number of fields
My guess is that the resolve_columns()
method in django.db.backend.oracle.query.OracleQuery
needs updating in light of the changes in [7340] (which moved the "extra" select columns to the front of the output columns list), but that's just a guess.
Attachments (2)
Change History (8)
comment:1 by , 17 years ago
Triage Stage: | Unreviewed → Accepted |
---|
by , 17 years ago
Attachment: | oracle_resolve_columns_fix.patch added |
---|
comment:2 by , 17 years ago
Has patch: | set |
---|
comment:3 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:4 by , 17 years ago
Keywords: | qs-rf added |
---|---|
Resolution: | fixed |
Status: | closed → reopened |
I'm reopening this because it's not a complete fix. The patch fixes the immediate problem, but it also removes all extra_select columns from the result set returned by Oracle, which causes queries that use extra_select to go haywire.
Just putting the extra_select columns back into the returned row causes the original error to occur again, and it turns out that the reason for this is that OracleQuery.as_sql is adding the 'rn' column to the extra_select after the QuerySet.iterator method has polled it to determine the number of extra_select columns. So OracleQuery.as_sql should not be adding anything to extra_select, period. The new patch fixes this by adding a row number placeholder to extra_select at the time Query.set_limits is called.
by , 17 years ago
Attachment: | 7036_redux.diff added |
---|
comment:5 by , 17 years ago
Cc: | added |
---|
comment:6 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Fixed in [7443]. Thanks, Ian.
Fix for OracleQuery.resolve_columns due to changes in #7340.