Opened 16 years ago

Closed 16 years ago

#7096 closed (fixed)

incorrect SQL generated for queryset multiple argument .exclude() calls

Reported by: oyvind Owned by: nobody
Component: Database layer (models, ORM) Version: dev
Severity: Keywords: exclude in not
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Model.objects.exclude(afield__in=[1,2], somefield__exact='something')

yields wrong sql

NOT (NOT afield in (1,2) AND somefield LIKE 'something')

Should be

NOT (afield in (1,2) AND somefield LIKE 'something')

Change History (3)

comment:1 by Chris Beaven, 16 years ago

Needs tests: set
Triage Stage: UnreviewedAccepted

I can confirm this bug, just recreated.

comment:2 by Chris Beaven, 16 years ago

Summary: problems with exclude and __in queries after queryset refactor mergeincorrect SQL generated for queryset multiple argument .exclude() calls

More testing shows that it's not a problem with __in, but any multiple argument exclude call.

comment:3 by Malcolm Tredinnick, 16 years ago

Resolution: fixed
Status: newclosed

(In [7493]) Fixed #7096 -- The simplifications in [7461] weren't complete. They broke
multi-component exclude() calls. Fixed that.

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