Changes between Initial Version and Version 7 of Ticket #12807
- Timestamp:
- Aug 19, 2013, 7:38:19 AM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #12807
- Property Triage Stage Unreviewed → Accepted
- Property Type → Bug
- Property Severity → Normal
- Property Easy pickings unset
- Property Patch needs improvement set
- Property UI/UX unset
-
Ticket #12807 – Description
initial v7 1 1 The following query: 2 2 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))` 4 4 5 currently breaks, since ~Q(pk__in=[])isn't noticed as being full, thus leading to the following query:5 currently breaks, since `~Q(pk__in=[])` isn't noticed as being full, thus leading to the following query: 6 6 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()` 8 8 ('SELECT "auth_user"."id" FROM "auth_user" WHERE (("auth_user"."id" = %s ) AND "auth_user"."id" = %s )', (3, 1)) 9 9 10 10 and giving an empty result set, instead of the correct 11 11 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()` 13 13 ('SELECT "auth_user"."id" FROM "auth_user" WHERE ("auth_user"."id" = %s )', (1,)) 14 14