Opened 8 years ago

Closed 8 years ago

Last modified 5 years ago

#7961 closed (duplicate)

Removing select statements added through extra() does not remove the corresponding select_params

Reported by: Matthijs Owned by: Malcolm Tredinnick
Component: Uncategorized Version: master
Severity: Keywords: extra query queryset
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

related to: #7957

if you add a (using extra()) a select statement with key 'foo' and a corresponding parameter 'bar' and then use filter(id='1').values_list('id')
the query to the database will use 'bar', '1' as parameters instead of just '1'. This results in either the wrong data returned or nothing returned.

Attachments (2)

django_extra.diff (5.7 KB) - added by Matthijs 8 years ago.
reproduce_extra_problem.py (3.5 KB) - added by Matthijs 8 years ago.
File to reproduce the problem and verify the fix

Download all attachments as: .zip

Change History (10)

Changed 8 years ago by Matthijs

Attachment: django_extra.diff added

Changed 8 years ago by Matthijs

Attachment: reproduce_extra_problem.py added

File to reproduce the problem and verify the fix

comment:1 Changed 8 years ago by Matthijs

Resolution: fixed
Status: newclosed

comment:2 Changed 8 years ago by Matthijs

Resolution: fixed
Status: closedreopened

comment:3 Changed 8 years ago by Matthijs

milestone: 1.0 beta1.0

Fixed milestone setting

comment:4 Changed 8 years ago by Malcolm Tredinnick

Owner: changed from Matthijs to Malcolm Tredinnick
Status: reopenednew

Going to assign to me so that I can find it quickly. This is now in my review and commit pile and getting close to the top.

comment:5 Changed 8 years ago by anonymous

Triage Stage: UnreviewedAccepted

comment:6 Changed 8 years ago by Malcolm Tredinnick

Resolution: duplicate
Status: newclosed

Closing as a dupe of #8191 just so that there's a single tracking ticket for the broader problem. This is a symptom of the parameter handling in extra().

comment:7 Changed 8 years ago by Malcolm Tredinnick

(In [8426]) Changed the (internal) way extra(select=.., select_params=...) handling is done
so that parameters stay with their select items. This means that merging and
trimming of those items is handled correctly.

Refs #7957, #7961. Fixed #8191.

comment:6 Changed 5 years ago by Jacob

milestone: 1.0

Milestone 1.0 deleted

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