#35147: Unexcepted behaviour for the filter() method of the QuerySet in version
               Reporter:  Darbados   |          Owner:  nobody
                   Type:  Bug        |         Status:  new
              Component:  Database   |        Version:  5.0
  layer (models, ORM)                |       Keywords:  annotate, bitand,
               Severity:  Normal     |  filter
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
 Hi team,

 I faced an unexpected behaviour of the bitand method of the F model when
 used with a BigIntField value.
 The change is that when I try to annotate and then filter on the promoted
 field, the query set is always empty, when it shouldn't be.

 Code is as follows:

 records_qs =

 The returned queryset is empty, but it shouldn't be.
 Simple test with using only annotate and further filtration using python
 list comprehension from the queryset using the annotated field, returns
 the needed records.

 The filtration works properly for flag values < {{{ 2**31 }}}.

 I was looking for some notes in the Django 5 release notes, but I found
 nothing, and this is the version where the problem is faced. With Django
 4.2.8 this problem is not faced.

 Petar Netev
Ticket URL: <https://code.djangoproject.com/ticket/35147>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 

Reply via email to