Fixed #20507 -- SubqueryConstraint alias handling

MySQL should work now, too.
This commit is contained in:
Anssi Kääriäinen 2013-05-27 14:59:16 +03:00
parent 7a92312827
commit 37ea9f9c03
1 changed files with 1 additions and 2 deletions

View File

@ -17,8 +17,7 @@ class SQLCompiler(compiler.SQLCompiler):
values.append(value)
return row[:index_extra_select] + tuple(values)
def as_subquery_condition(self, alias, columns):
qn = self.quote_name_unless_alias
def as_subquery_condition(self, alias, columns, qn):
qn2 = self.connection.ops.quote_name
sql, params = self.as_sql()
return '(%s) IN (%s)' % (', '.join(['%s.%s' % (qn(alias), qn2(column)) for column in columns]), sql), params