Opened 17 years ago
Closed 17 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 , 17 years ago
Needs tests: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 17 years ago
Summary: | problems with exclude and __in queries after queryset refactor merge → incorrect 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 , 17 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
I can confirm this bug, just recreated.