Changes between Initial Version and Version 7 of Ticket #12807


Ignore:
Timestamp:
Aug 19, 2013, 7:38:19 AM (11 years ago)
Author:
Anssi Kääriäinen
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #12807

    • Property Triage Stage UnreviewedAccepted
    • Property TypeBug
    • Property SeverityNormal
    • Property Easy pickings unset
    • Property Patch needs improvement set
    • Property UI/UX unset
  • 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