#34590: Querying for decimals larger than max_digits crashes on SQLite
-------------------------------------+-------------------------------------
     Reporter:  Marc Odermatt        |                    Owner:  Mohit
                                     |  Singh Sinsniwal
         Type:  Bug                  |                   Status:  assigned
    Component:  Database layer       |                  Version:  4.2
  (models, ORM)                      |
     Severity:  Release blocker      |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Simon Charette):

 You're right, the `EmptyResultSet` approach failed to account for lte and
 friends that would have to be adjusted as well like we did with
 `IntegerField`.

 What would be good to confirm if we can't revert this change is what the
 previous logic did for cases where an extra decimal was provided. Was it a
 non-match on all backends? Were some of them performing rounding?

 For example, given `field = DecimalField(max_digits=4, decimal_places=2)`
 what does `filter(Q(field=Decimal('42.425')) | Q(field=Decimal('42.424'))
 | Q(field=Decimal('42.426')))` yielded on all backends against existing
 rows values of `42.42` and `42.43`. I agree that we don't want to start
 erroring out here without deprecation period though so this is more of
 exploration work but I could see why we could want to error out
 immediately when providing invalid lookup values.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34590#comment:9>
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018845f2b15d-45edfe3d-230b-4143-aa37-082a90d9bb70-000000%40eu-central-1.amazonses.com.

Reply via email to