Skip to content

[pull] main from django:main - #550

Merged
pull[bot] merged 9 commits into
threatcode:mainfrom
django:main
Sep 2, 2026
Merged

[pull] main from django:main#550
pull[bot] merged 9 commits into
threatcode:mainfrom
django:main

Conversation

@pull

@pull pull Bot commented Sep 2, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

yassinbahri and others added 9 commits September 2, 2026 14:15
…lookups.

Regression in 7b54ddd.

Thank you Oleksandr Tatarinov for the report and Clifford Gama for the review.
…lection in in_bulk().

Bug in 1820d35.

Thank you to Jacob Walls for the review.
…ons.

When two lookup paths resolve to the same column, values() selects that
column once per path, at a different position each time. get_distinct()
refers to such selections by expression, and PostgreSQL binds an
expression reference to the first position the expression is selected
at. Ordering referred to each selection by its own position, so the
later ones yielded sort keys that DISTINCT ON could not be matched
against:

    SELECT DISTINCT ON expressions must match initial ORDER BY
    expressions

Ordering now refers to the first position an expression is selected at
when distinct fields are used. Annotations take part in that, as
PostgreSQL binds to their position as well when they select an
expression first, but their alias keeps referring to their own position
since get_distinct() refers to annotations by alias. Raw selections are
left out as equal SQL is not necessarily interchangeable, e.g. two
volatile extra() selections must keep ordering by their own position.

Regression in 65ad4ad.

Thanks Robert Leach for the report and Simon Charette for the review.
@pull pull Bot locked and limited conversation to collaborators Sep 2, 2026
@pull pull Bot added the ⤵️ pull label Sep 2, 2026
@pull
pull Bot merged commit 5180f82 into threatcode:main Sep 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants