diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2009-01-08 05:15:41 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2009-01-08 05:15:41 +0000 |
| commit | d00c013cc8477de9a75e4b4f5806034549e5a5e1 (patch) | |
| tree | a2c36cbec9aaf3b7c36e7285263e58e16048a704 /django/db/models/sql/query.py | |
| parent | c20019a91d7d553606f45d21c513f277fb98deb4 (diff) | |
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
previously).
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9714 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/models/sql/query.py')
| -rw-r--r-- | django/db/models/sql/query.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py index 432e5e6332..876099cb1f 100644 --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -317,11 +317,13 @@ class BaseQuery(object): """ 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) obj.bump_prefix() return obj.as_sql() |
