#11916: Extra params + aggregation creates incorrect SQL.
---------------------------------------------------+------------------------
          Reporter:  [email protected]          |         Owner:  nobody
            Status:  new                           |     Milestone:  1.2   
         Component:  Database layer (models, ORM)  |       Version:  1.1   
        Resolution:                                |      Keywords:        
             Stage:  Accepted                      |     Has_patch:  1     
        Needs_docs:  0                             |   Needs_tests:  0     
Needs_better_patch:  0                             |  
---------------------------------------------------+------------------------
Comment (by ikelly):

 The test case still fails in Oracle for a variety of reasons:

  1. The subquery uses LIMIT, which Oracle doesn't directly support.
  2. Oracle also doesn't like the ORDER BY in the subquery; since it's
 supposed to be a scalar subquery, and LIMIT is not allowed, the clause is
 viewed as extraneous.
  3. Most problematically, Oracle doesn't actually support subqueries in
 the GROUP BY clause at all.  The reason for the duplication in the GROUP
 BY clause is to support other types of expressions.  For more information
 on this, see #10290 and [http://groups.google.com/group/django-
 
developers/browse_thread/thread/17518aec1a0fe83f/73893a86d31708d0?hl=en&lnk=gst&q=%2310290#73893a86d31708d0
 the django-developers discussion about it].

 However, the important thing here is that this patch isn't causing any
 other test failures in Oracle, and because of 3. we were already expecting
 this case to fail, so I would be happy with committing it.  The only thing
 I ask is that the test case be smoothed over for Oracle -- either by
 making the extra select something other than a subquery (which may not be
 possible for this bug) or simply by skipping it when the backend is
 oracle.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/11916#comment:16>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to