Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed Oracle specific failures in multicolumn joins

Refs #19385
  • Loading branch information...
commit 9c4882b391157f6aa3c0ade309638ffcd3bdf684 1 parent 2423455
@akaariai akaariai authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 django/db/models/sql/where.py
View
6 django/db/models/sql/where.py
@@ -395,10 +395,10 @@ def as_sql(self, qn, connection):
# QuerySet was sent
if hasattr(query, 'values'):
- # as_sql should throw if we are using a
- # connection on another database
- query._as_sql(connection=connection)
+ if query._db and connection.alias != query._db:
+ raise ValueError("Can't do subqueries with queries on different DBs.")
query = query.values(*self.targets).query
+ query.clear_ordering(True)
query_compiler = query.get_compiler(connection=connection)
return query_compiler.as_subquery_condition(self.alias, self.columns)

0 comments on commit 9c4882b

Please sign in to comment.
Something went wrong with that request. Please try again.