#24924 closed Uncategorized (fixed)
Incorrect Join Promotion with Annotations
Reported by: | Mark Lavin | Owned by: | nobody |
---|---|---|---|
Component: | Uncategorized | Version: | 1.8 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
This was originally addressed in #24766 and released in 1.8.2 but as noted here https://code.djangoproject.com/ticket/24766#comment:7 this problem still exists if there are multiple annotations. Working on a failing test case.
Attachments (1)
Change History (5)
by , 9 years ago
Attachment: | 24924.diff added |
---|
comment:1 by , 9 years ago
Attached a test case that fails because of this issue.
$ python runtests.py expressions_case Creating test database for alias 'default'... Creating test database for alias 'other'... ......................................F.....................s............... ====================================================================== FAIL: test_join_promotion_with_multiple_annotations (expressions_case.tests.CaseExpressionTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/rob/rob/caktus/django/tests/expressions_case/tests.py", line 1073, in test_join_promotion_with_multiple_annotations lambda x: (x, x.foo, x.bar) File "/home/rob/rob/caktus/django/django/test/testcases.py", line 932, in assertQuerysetEqual return self.assertEqual(list(items), values, msg=msg) AssertionError: Lists differ: [] != [(<CaseTestModel: 1, 1>, 3, 5)] Second list contains 1 additional elements. First extra element 0: (<CaseTestModel: 1, 1>, 3, 5) - [] + [(<CaseTestModel: 1, 1>, 3, 5)] ---------------------------------------------------------------------- Ran 76 tests in 0.172s FAILED (failures=1, skipped=1) Destroying test database for alias 'default'... Destroying test database for alias 'other'...
The query returns an empty list because of the inner join.
comment:2 by , 9 years ago
Has patch: | set |
---|
Added PR to fix https://github.com/django/django/pull/4810. Docs added under the assumption that this bug would be backported to 1.8.X.
Note:
See TracTickets
for help on using tickets.
Failing test case