On Tue, Feb 17, 2009 at 6:05 PM, Ian Kelly <[email protected]> wrote:
> > I'd like to request some extra sets of eyes for the patch in ticket #10290. > > The summary: from r9838 on, I'm getting aggregation_regress test > failures in Oracle, apparently because annotations with extra selects > are adding the extra select aliases into the group by list. This > produces invalid SQL (at least in Oracle), since you can't use column > aliases defined at the same level within a group by clause. > > The solution that I'm proposing is to use the extra select expression > itself in the group by, rather than the alias. This passes the tests > across all four included backends, and seems to work in general as > long as the expression is not a scalar subquery (in which case I think > a general solution would require advanced inspection of the > expression). But it bothers me a bit because it just feels fragile. > > If there are no concerns or potential gotchas with this approach, then > I'll go ahead and commit this in a few days. > > Thanks, > Ian > > > > As you mention it is fragile, and depending on how good the backends optimizer is it could require doing whatever computation 2x(which is undesirable), so I'd say make it an attribute on features and test for it when deciding which to use in group_by. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people's good is the highest law."--Cicero --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" 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-developers?hl=en -~----------~----~----~----~------~----~------~--~---
