diff options
| author | Anssi Kääriäinen <akaariai@gmail.com> | 2013-03-24 22:55:30 +0200 |
|---|---|---|
| committer | Anssi Kääriäinen <akaariai@gmail.com> | 2013-03-24 22:56:40 +0200 |
| commit | 9c4882b391157f6aa3c0ade309638ffcd3bdf684 (patch) | |
| tree | e8795123500b6872a6c49a2b3a5fd3b01ab71090 | |
| parent | 24234555a01f3ebff2e969210024c86842896671 (diff) | |
Fixed Oracle specific failures in multicolumn joins
Refs #19385
| -rw-r--r-- | django/db/models/sql/where.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/django/db/models/sql/where.py b/django/db/models/sql/where.py index c738c914d1..029226383d 100644 --- a/django/db/models/sql/where.py +++ b/django/db/models/sql/where.py @@ -395,10 +395,10 @@ class SubqueryConstraint(object): # 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) |
