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:
parent
b9d698e9f2
commit
89ded975fe
|
@ -55,7 +55,7 @@ class GeoSQLCompiler(compiler.SQLCompiler):
|
|||
aliases.add(r)
|
||||
col_aliases.add(col[1])
|
||||
else:
|
||||
result.append(col.as_sql(qn=qn))
|
||||
result.append(col.as_sql(qn, self.connection))
|
||||
|
||||
if hasattr(col, 'alias'):
|
||||
aliases.add(col.alias)
|
||||
|
@ -70,7 +70,7 @@ class GeoSQLCompiler(compiler.SQLCompiler):
|
|||
max_name_length = self.connection.ops.max_name_length()
|
||||
result.extend([
|
||||
'%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
|
||||
and ' AS %s' % qn(truncate_name(alias, max_name_length))
|
||||
or ''
|
||||
|
|
Loading…
Reference in New Issue