Opened 18 years ago
Closed 18 years ago
#6837 closed (fixed)
Bug in db.models.query.as_sql() with multiple where clauses
| Reported by: | Paul Smith | Owned by: | nobody | 
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | queryset-refactor | 
| Severity: | Keywords: | ||
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no | 
| Needs tests: | no | Patch needs improvement: | no | 
| Easy pickings: | no | UI/UX: | no | 
Description
If you give extra a list of where clauses, and there's more than one clause in the list, the query will fail, because the generated SQL, by db.models.query.as_sql() has a typo.
For example:
Mumble.objects.extra(where=["foo='bar'", "jazz='jimmy'"])
makes the following WHERE SQL:
foo='bar' ANDjazz='jimmy'
Attachments (1)
Change History (2)
by , 18 years ago
| Attachment: | missing-space.diff added | 
|---|
comment:1 by , 18 years ago
| Resolution: | → fixed | 
|---|---|
| Status: | new → closed | 
  Note:
 See   TracTickets
 for help on using tickets.
    
Just fixed in r7327