Skip to content

Commit

Permalink
Fixed #20507 -- SubqueryConstraint alias handling
Browse files Browse the repository at this point in the history
MySQL should work now, too.
  • Loading branch information
akaariai committed May 27, 2013
1 parent 7a92312 commit 37ea9f9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions django/db/backends/mysql/compiler.py
Expand Up @@ -17,8 +17,7 @@ def resolve_columns(self, row, fields=()):
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
Expand Down

0 comments on commit 37ea9f9

Please sign in to comment.