[Django] #37047: Crash in Query.orderby_issubset_groupby for descending and random order_by strings

3 views
Skip to first unread message

Django

unread,
7:52 AM (14 hours ago) 7:52 AM
to django-...@googlegroups.com
#37047: Crash in Query.orderby_issubset_groupby for descending and random order_by
strings
-------------------------------------+-------------------------------------
Reporter: Anže Pečar | Type: Bug
Status: new | Component: Database
| layer (models, ORM)
Version: dev | Severity: Normal
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
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
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/37047>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
7:59 AM (14 hours ago) 7:59 AM
to django-...@googlegroups.com
#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>
Reply all
Reply to author
Forward
0 new messages