New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QuerySet slices in Oracle return the ROWNUM value as the first column #98

Closed
bruth opened this Issue Jun 6, 2013 · 0 comments

Comments

Projects
None yet
1 participant
@bruth
Member

bruth commented Jun 6, 2013

Line is interest: https://github.com/django/django/blob/master/django/db/backends/oracle/compiler.py#L53-L55

This should convert the line back to the original state: https://github.com/django/django/blob/master/django/db/backends/oracle/compiler.py#L10-L23

The issue is that a RawQuery is being used in ModelTree to construct the iterator which takes takes the raw SQL that contains the ROWNUM clause. This needs to be wrapped in another layer to resolve it back to the original state.

bruth added a commit to chop-dbhi/modeltree that referenced this issue Jun 6, 2013

Replace RawQuery with compiler.results_iter()
This originated with behavior seen in Avocado where data was being shifted.
It was discovered to be the Oracle ROWNUM identifier that was prepended to
each row. See chop-dbhi/avocado#98

Fix #8

@bruth bruth closed this Jun 6, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment