Refs #32786 -- Made query clear ordering when ordered combined queryset is used in subquery on Oracle.
This commit is contained in:
parent
20b6e30858
commit
c48b34e26d
|
@ -116,11 +116,6 @@ class DatabaseFeatures(BaseDatabaseFeatures):
|
|||
"migrations.test_operations.OperationTests."
|
||||
"test_alter_field_pk_fk_db_collation",
|
||||
},
|
||||
"Oracle raises an error when a subquery contains unnecessary ORDER BY "
|
||||
"clause (#32786).": {
|
||||
"queries.test_qs_combinators.QuerySetSetOperationTests."
|
||||
"test_union_in_with_ordering",
|
||||
},
|
||||
}
|
||||
django_test_expected_failures = {
|
||||
# A bug in Django/cx_Oracle with respect to string handling (#23843).
|
||||
|
|
|
@ -1178,6 +1178,8 @@ class Query(BaseExpression):
|
|||
and not connection.features.ignores_unnecessary_order_by_in_subqueries
|
||||
):
|
||||
self.clear_ordering(force=False)
|
||||
for query in self.combined_queries:
|
||||
query.clear_ordering(force=False)
|
||||
sql, params = self.get_compiler(connection=connection).as_sql()
|
||||
if self.subquery:
|
||||
sql = "(%s)" % sql
|
||||
|
|
Loading…
Reference in New Issue