Opened 23 months ago

Closed 23 months ago

Last modified 23 months 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 Changed 23 months ago by Loic Bistuer

Triage Stage: UnreviewedReady for checkin

comment:3 Changed 23 months ago by felixxm

Severity: NormalRelease blocker

comment:4 Changed 23 months ago by Tim Graham <timograham@…>

Resolution: fixed
Status: newclosed

In 3187c89:

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

comment:5 Changed 23 months ago by Tim Graham <timograham@…>

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