Changes between Initial Version and Version 7 of Ticket #12807


Ignore:
Timestamp:
08/19/2013 07:38:19 AM (6 years ago)
Author:
Anssi Kääriäinen
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #12807

    • Property Severity changed from to Normal
    • Property Patch needs improvement set
    • Property Easy pickings unset
    • Property UI/UX unset
    • Property Type changed from to Bug
    • Property Triage Stage changed from Unreviewed to Accepted
  • Ticket #12807 – Description

    initial v7  
    11The following query:
    22
    3     User.objects.filter((Q(pk=3) | ~Q(pk__in=[]) & Q(pk=1))
     3    `User.objects.filter((Q(pk=3) | ~Q(pk__in=[]) & Q(pk=1))`
    44
    5 currently breaks, since ~Q(pk__in=[]) isn't noticed as being full, thus leading to the following query:
     5currently breaks, since `~Q(pk__in=[])` isn't noticed as being full, thus leading to the following query:
    66
    7     >>> User.objects.filter((Q(pk=3) | ~Q(pk__in=[])) & Q(pk=1)).values('id').query.as_sql()
     7    >>> `User.objects.filter((Q(pk=3) | ~Q(pk__in=[])) & Q(pk=1)).values('id').query.as_sql()`
    88    ('SELECT "auth_user"."id" FROM "auth_user" WHERE (("auth_user"."id" = %s ) AND "auth_user"."id" = %s )', (3, 1))
    99
    1010and giving an empty result set, instead of the correct
    1111
    12     >>> User.objects.filter((Q(pk=3) | ~Q(pk__in=[])) & Q(pk=1)).values('id').query.as_sql()
     12    >>> `User.objects.filter((Q(pk=3) | ~Q(pk__in=[])) & Q(pk=1)).values('id').query.as_sql()`
    1313    ('SELECT "auth_user"."id" FROM "auth_user" WHERE ("auth_user"."id" = %s )', (1,))
    1414
Back to Top