#24924: Incorrect Join Promotion with Annotations
-------------------------------+--------------------------------------
Reporter: mlavin | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by robline):
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
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.
--
Ticket URL: <https://code.djangoproject.com/ticket/24924#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/064.8feadfd549d0cd650fddbab8c02f7f74%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.