* owner: nobody => Mohamed Nabil Rady
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/34346#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by Mariusz Felisiak):
Mohamed, thanks. Do you have time to fix it over the weekend? This is a
release blocker for Django 4.2, so we should fix it by Monday.
--
Ticket URL: <https://code.djangoproject.com/ticket/34346#comment:3>
Comment (by Simon Charette):
If not I have a pretty good idea on how to fix it by excluding `Col`
instances from order by selected replacements.
--
Ticket URL: <https://code.djangoproject.com/ticket/34346#comment:4>
Comment (by Mohamed Nabil Rady):
I am not that familiar with the codebase so I can't make any promises, so
I guess it's for the best to leave another person with the bug.
I found out the issue happens because before the regression in
`django.db.models.sql.compiler.SQLCompiler.get_order_by` would return a
`Col` object, but it now it returns `Ref` object which points to the
correct column but its `as_sql` method returns the annotated value name
instead of the unambiguous SQL.
I am not sure to what extent is this information useful or if it's
obvious, but as I said I am not that familiar with the codebase, and I am
not sure what `Ref` objects are responsible for.
--
Ticket URL: <https://code.djangoproject.com/ticket/34346#comment:5>
* owner: Mohamed Nabil Rady => (none)
* status: assigned => new
--
Ticket URL: <https://code.djangoproject.com/ticket/34346#comment:6>
* owner: (none) => Simon Charette
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/34346#comment:7>
* has_patch: 0 => 1
* stage: Accepted => Ready for checkin
Comment:
[https://github.com/django/django/pull/16571 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/34346#comment:8>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"278881e37619278789942513916acafaa88d26f3" 278881e3]:
{{{
#!CommitTicketReference repository=""
revision="278881e37619278789942513916acafaa88d26f3"
Fixed #34346 -- Ordered selected expressions by position.
Used the same approach as for #34176 by using selected expressions
position to prevent ambiguous aliases in collisions.
Thanks henribru for the report.
Regression in 04518e310d4552ff7595a34f5a7f93487d78a406.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/34346#comment:9>
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):
In [changeset:"aab25a69dd09e6717ff86175ff62c29b847a7791" aab25a6]:
{{{
#!CommitTicketReference repository=""
revision="aab25a69dd09e6717ff86175ff62c29b847a7791"
[4.2.x] Fixed #34346 -- Ordered selected expressions by position.
Used the same approach as for #34176 by using selected expressions
position to prevent ambiguous aliases in collisions.
Thanks henribru for the report.
Regression in 04518e310d4552ff7595a34f5a7f93487d78a406.
Backport of 278881e37619278789942513916acafaa88d26f3 from main
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/34346#comment:10>