mirror of https://github.com/django/django.git
Fixed #20507 -- SubqueryConstraint alias handling
MySQL should work now, too.
This commit is contained in:
parent
7a92312827
commit
37ea9f9c03
|
@ -17,8 +17,7 @@ class SQLCompiler(compiler.SQLCompiler):
|
||||||
values.append(value)
|
values.append(value)
|
||||||
return row[:index_extra_select] + tuple(values)
|
return row[:index_extra_select] + tuple(values)
|
||||||
|
|
||||||
def as_subquery_condition(self, alias, columns):
|
def as_subquery_condition(self, alias, columns, qn):
|
||||||
qn = self.quote_name_unless_alias
|
|
||||||
qn2 = self.connection.ops.quote_name
|
qn2 = self.connection.ops.quote_name
|
||||||
sql, params = self.as_sql()
|
sql, params = self.as_sql()
|
||||||
return '(%s) IN (%s)' % (', '.join(['%s.%s' % (qn(alias), qn2(column)) for column in columns]), sql), params
|
return '(%s) IN (%s)' % (', '.join(['%s.%s' % (qn(alias), qn2(column)) for column in columns]), sql), params
|
||||||
|
|
Loading…
Reference in New Issue