Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#1614 closed defect (fixed)

query.lookup_inner doesn't update tables

Reported by: anonymous Owned by: adrian
Component: Core (Other) Version: magic-removal
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


django.db.models.query.lookup_inner returns a (tables,joins,where,params) tuple. After staring at this 140-line piece of spaggeti code, I'm still unsure of what and why it does what it does, but for one thing, the returned tables list is always empty. The only place where tables is modified is at the line " tables.extend(tables2)", but tables2 is the returned tables list from a recursive call of lookup_inner. There should be a tables.append(sometable) somewhere, just like where and params. If this is not a bug and tables should in fact always be empty, what's the point of returning it ?

So, how about taking the chance to refactor things a little when this is fixed ?

Change History (3)

comment:1 Changed 9 years ago by adrian

I'm indeed looking into refactoring this to get rid of the crap in there.

comment:2 Changed 9 years ago by adrian

  • Status changed from new to assigned

comment:3 Changed 9 years ago by adrian

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed in [3317].

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