Opened 16 years ago

Closed 16 years ago

Last modified 13 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: dev
Severity: Keywords: extra query queryset
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

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 16 years ago.
reproduce_extra_problem.py (3.5 KB ) - added by Matthijs 16 years ago.
File to reproduce the problem and verify the fix

Download all attachments as: .zip

Change History (10)

by Matthijs, 16 years ago

Attachment: django_extra.diff added

by Matthijs, 16 years ago

Attachment: reproduce_extra_problem.py added

File to reproduce the problem and verify the fix

comment:1 by Matthijs, 16 years ago

Resolution: fixed
Status: newclosed

comment:2 by Matthijs, 16 years ago

Resolution: fixed
Status: closedreopened

comment:3 by Matthijs, 16 years ago

milestone: 1.0 beta1.0

Fixed milestone setting

comment:4 by Malcolm Tredinnick, 16 years ago

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 by anonymous, 16 years ago

Triage Stage: UnreviewedAccepted

comment:6 by Malcolm Tredinnick, 16 years ago

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 by Malcolm Tredinnick, 16 years ago

(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 by Jacob, 13 years ago

milestone: 1.0

Milestone 1.0 deleted

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