Opened 9 years ago

Closed 9 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: UI/UX:

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)

missing-space.diff (907 bytes) - added by Paul Smith 9 years ago.

Download all attachments as: .zip

Change History (2)

Changed 9 years ago by Paul Smith

Attachment: missing-space.diff added

comment:1 Changed 9 years ago by Alex Gaynor

Resolution: fixed
Status: newclosed

Just fixed in r7327

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