Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#29067 closed Bug (fixed)

QuerySet.values_list(..., flat=True) combined with .annotate() incorrectly includes the annotate columns

Reported by: Jon Dufresne Owned by: nobody
Component: Database layer (models, ORM) Version: 2.0
Severity: Release blocker Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Regression introduced in Django 2.0.

In FlatValuesListIterable.__iter__(), can't assume the returned rows have a single column as using .annotate() may have added additional columns to the SELECT.

Introduction bisected to commit 4dfd6b88d520b43b6363946e5ee58ba14cd1efe6.

Change History (5)

comment:2 by Loic Bistuer, 6 years ago

Triage Stage: UnreviewedReady for checkin

comment:3 by Mariusz Felisiak, 6 years ago

Severity: NormalRelease blocker

comment:4 by Tim Graham <timograham@…>, 6 years ago

Resolution: fixed
Status: newclosed

In 3187c89:

Fixed #29067 -- Fixed regression in QuerySet.values_list(..., flat=True) followed by annotate().

comment:5 by Tim Graham <timograham@…>, 6 years ago

In 61c74ae:

[2.0.x] Fixed #29067 -- Fixed regression in QuerySet.values_list(..., flat=True) followed by annotate().

Regression in 4dfd6b88d520b43b6363946e5ee58ba14cd1efe6.

Backport of 3187c89d6f8c60ca7e78093d5b37e0709e71cea9 from master

Note: See TracTickets for help on using tickets.
Back to Top