Opened 5 days ago
Closed 5 days ago
#37090 closed Bug (duplicate)
Combined query targeted by In fails on Oracle if deeper combined queries are ordered
| Reported by: | Jacob Walls | Owned by: | Sidharth Dusanapudi |
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Sidharth Dusanapudi | Triage Stage: | Unreviewed |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
During review of a related PR for #36938, we discovered another Oracle-only failure relating to clearing of unnecessary order_by inside unions.
We noticed test_union_in_with_ordering added in #33796 only accounts for one depth.
Failing test:
@skipUnlessDBFeature("supports_slicing_ordering_in_compound") def test_union_in_with_ordering_union(self): qs1 = Number.objects.filter(num__gt=7).order_by("id") qs2 = Number.objects.filter(num__lt=2).order_by("-id") qs3 = Number.objects.filter(num=5).order_by("id") union = qs1.union(qs2).order_by("id") self.assertNumbersEqual( Number.objects.exclude( id__in=union.union(qs3).order_by("-id").values("id") ), [2, 3, 4, 6, 7], ordered=False, )
django.db.utils.DatabaseError: ORA-00907: missing right parenthesis Help: https://docs.oracle.com/error-help/db/ora-00907/
I'll extract the changes into a separate PR.
Change History (2)
comment:1 by , 5 days ago
comment:2 by , 5 days ago
| Resolution: | → duplicate |
|---|---|
| Status: | assigned → closed |
Sorry, this is a duplicate of #36938, the same change covers both.
Note:
See TracTickets
for help on using tickets.
PR