Opened 17 years ago

Closed 17 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)

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

Download all attachments as: .zip

Change History (2)

by Paul Smith, 17 years ago

Attachment: missing-space.diff added

comment:1 by Alex Gaynor, 17 years ago

Resolution: fixed
Status: newclosed

Just fixed in r7327

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