Browse files

Remove any ordering from a nested select query (in the where-clause).

This fixes r9701 for Oracle (the test introduced there did its job and failed

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
malcolmt committed Jan 8, 2009
1 parent c20019a commit d00c013cc8477de9a75e4b4f5806034549e5a5e1
Showing with 3 additions and 1 deletion.
  1. +3 −1 django/db/models/sql/
@@ -317,11 +317,13 @@ def as_nested_sql(self):
Perform the same functionality as the as_sql() method, returning an
SQL string and parameters. However, the alias prefixes are bumped
- beforehand (in a copy -- the current query isn't changed).
+ beforehand (in a copy -- the current query isn't changed) and any
+ ordering is removed.
Used when nesting this query inside another.
obj = self.clone()
+ obj.clear_ordering(True)
return obj.as_sql()

0 comments on commit d00c013

Please sign in to comment.