#7818: Merging querysets can result in wrong operator grouping
------------------------------+---------------------------------------------
 Reporter:  andrewbadr        |       Owner:  mtredinnick
   Status:  new               |   Milestone:             
Component:  Database wrapper  |     Version:  SVN        
 Keywords:                    |       Stage:  Unreviewed 
Has_patch:  0                 |  
------------------------------+---------------------------------------------
 If you do (Foo.objects.filter(bar=x) | Foo.objects.filter(bar=y)) &
 Foo.objects.filter(baz=x) the query's WHERE clause will look like "bar=x
 OR bar=y AND baz=z". This is wrong because the ORs should be
 parenthesized. Using the |, & operators on Q objects results in the
 correct behavior.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/7818>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to