Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #25081 -- Prevented DISTINCT ON ordering from being cleared in get(). #4974

Merged

Conversation

charettes
Copy link
Member

Also added a regression test for the ordering clearing optimisation performed in get() since no tests were failing if we simply removed the clone = clone.order_by() below and adjusted a test to correctly test captured queries SQL.

@@ -129,3 +129,8 @@ def test_distinct_on_in_ordered_subquery(self):
qs, [self.p1_o2, self.p2_o1, self.p3_o1],
lambda x: x
)

def test_distinct_on_get_ordering_preserved(self):
"""#25081 - Ordering shouldn't be cleared when distinct on fields are specified."""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd multiline to wrap at 79

@charettes charettes force-pushed the ticket-25081-get-distinct-on-ordering branch from 55541c4 to 8665631 Compare July 9, 2015 19:59
@charettes charettes force-pushed the ticket-25081-get-distinct-on-ordering branch from 8665631 to 11e6bf9 Compare July 9, 2015 20:00
@charettes charettes merged commit 11e6bf9 into django:master Jul 9, 2015
@charettes charettes deleted the ticket-25081-get-distinct-on-ordering branch July 9, 2015 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants