Opened 8 years ago

Closed 8 years ago

#6837 closed (fixed)

Bug in db.models.query.as_sql() with multiple where clauses

Reported by: p 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: UI/UX:


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)

missing-space.diff (907 bytes) - added by p 8 years ago.

Download all attachments as: .zip

Change History (2)

Changed 8 years ago by p

comment:1 Changed 8 years ago by Alex

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

Just fixed in r7327

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