Fixed #12479 -- Pass in connection argument to `as_sql` in `GeoSQLCompiler.get_columns`. Thanks, jpwatts, for bug report and initial patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12083 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Justin Bronn 2010-01-04 02:37:46 +00:00
parent b9d698e9f2
commit 89ded975fe
1 changed files with 3 additions and 3 deletions

View File

@ -55,7 +55,7 @@ class GeoSQLCompiler(compiler.SQLCompiler):
aliases.add(r) aliases.add(r)
col_aliases.add(col[1]) col_aliases.add(col[1])
else: else:
result.append(col.as_sql(qn=qn)) result.append(col.as_sql(qn, self.connection))
if hasattr(col, 'alias'): if hasattr(col, 'alias'):
aliases.add(col.alias) aliases.add(col.alias)
@ -70,7 +70,7 @@ class GeoSQLCompiler(compiler.SQLCompiler):
max_name_length = self.connection.ops.max_name_length() max_name_length = self.connection.ops.max_name_length()
result.extend([ result.extend([
'%s%s' % ( '%s%s' % (
self.get_extra_select_format(alias) % aggregate.as_sql(qn=qn, connection=self.connection), self.get_extra_select_format(alias) % aggregate.as_sql(qn, self.connection),
alias is not None alias is not None
and ' AS %s' % qn(truncate_name(alias, max_name_length)) and ' AS %s' % qn(truncate_name(alias, max_name_length))
or '' or ''