1
0
mirror of https://github.com/django/django.git synced 2025-07-05 18:29:11 +00:00

queryset-refactor: Don't use the "AS" keyword in the FROM-clause. Fixed #7055.

Patch from Ian Kelly.

This keyword is optional in SQL, but not permitted by Oracle. If we ever need
to support a backend that requires this keyword at some later date, we can make
it a connection.feature option, but that's overkill for now.


git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@7439 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick 2008-04-22 18:09:55 +00:00
parent c43a3d78b1
commit 88488e5aa5
2 changed files with 2 additions and 2 deletions

View File

@ -420,7 +420,7 @@ class Query(object):
if not self.alias_refcount[alias]: if not self.alias_refcount[alias]:
continue continue
name, alias, join_type, lhs, lhs_col, col, nullable = self.alias_map[alias] name, alias, join_type, lhs, lhs_col, col, nullable = self.alias_map[alias]
alias_str = (alias != name and ' AS %s' % alias or '') alias_str = (alias != name and ' %s' % alias or '')
if join_type and not first: if join_type and not first:
result.append('%s %s%s ON (%s.%s = %s.%s)' result.append('%s %s%s ON (%s.%s = %s.%s)'
% (join_type, qn(name), alias_str, qn(lhs), % (join_type, qn(name), alias_str, qn(lhs),

View File

@ -361,7 +361,7 @@ class CountQuery(Query):
""" """
def get_from_clause(self): def get_from_clause(self):
result, params = self._query.as_sql() result, params = self._query.as_sql()
return ['(%s) AS A1' % result], params return ['(%s) A1' % result], params
def get_ordering(self): def get_ordering(self):
return () return ()