#37047: Crash in Query.orderby_issubset_groupby for descending and random order_by
strings
-------------------------------------+-------------------------------------
Reporter: Anže Pečar | Owner: (none)
Type: Bug | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Anže Pečar:
Old description:
> ticket-26434 caused a crash. It can be reproduced with:
>
> {{{
> User.objects.values("is_staff").annotate(latest=Max("date_joined")).order_by("-latest").count()
> }}}
>
> You should see the following exception:
>
> {{{
> django.core.exceptions.FieldError: Cannot resolve keyword '-latest' into
> field. Choices are: activity_logs, date_joined, email, first_name,
> groups, id, is_active, is_administrator, is_staff, is_superuser,
> last_login, last_name, latest, logentry, module_access, password,
> user_permissions, username
> }}}
New description:
#26434 caused a crash. It can be reproduced with:
{{{
User.objects.values("is_staff").annotate(latest=Max("date_joined")).order_by("-latest").count()
}}}
You should see the following exception:
{{{
django.core.exceptions.FieldError: Cannot resolve keyword '-latest' into
field. Choices are: activity_logs, date_joined, email, first_name, groups,
id, is_active, is_administrator, is_staff, is_superuser, last_login,
last_name, latest, logentry, module_access, password, user_permissions,
username
}}}
--
--
Ticket URL: <
https://code.djangoproject.com/ticket/37047#comment:1>