Opened 7 years ago

Closed 7 years ago

Last modified 4 years ago

#7961 closed (duplicate)

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

Reported by: mullendr Owned by: mtredinnick
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 mullendr 7 years ago.
reproduce_extra_problem.py (3.5 KB) - added by mullendr 7 years ago.
File to reproduce the problem and verify the fix

Download all attachments as: .zip

Change History (10)

Changed 7 years ago by mullendr

Changed 7 years ago by mullendr

File to reproduce the problem and verify the fix

comment:1 Changed 7 years ago by mullendr

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to fixed
  • Status changed from new to closed

comment:2 Changed 7 years ago by mullendr

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:3 Changed 7 years ago by mullendr

  • milestone changed from 1.0 beta to 1.0

Fixed milestone setting

comment:4 Changed 7 years ago by mtredinnick

  • Owner changed from mullendr to mtredinnick
  • Status changed from reopened to new

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

  • Triage Stage changed from Unreviewed to Accepted

comment:6 Changed 7 years ago by mtredinnick

  • Resolution set to duplicate
  • Status changed from new to closed

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 7 years ago by mtredinnick

(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 4 years ago by jacob

  • milestone 1.0 deleted

Milestone 1.0 deleted

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