#24662: Sum() returns True/False when used with BooleanField & MySQL
-------------------------------------+-------------------------------------
     Reporter:  chriskief            |                    Owner:  marco-
                                     |  santamaria
         Type:  Bug                  |                   Status:  assigned
    Component:  Database layer       |                  Version:  1.8
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by chriskief):

 True doesn't seem like the correct behavior to me either, but I'm also
 surprised that this worked correctly in the past now that I understand
 what's going on.

 My gut says to lean towards consistency in behavior and in that case, it's
 strange that True is returned when there's a single row in the database,
 and a Decimal is returned when there is more than one row. In addition, a
 numeric value is returned in all cases when using SQLite.

 Should probably take a look at what Postgres and Oracle return as well.

--
Ticket URL: <https://code.djangoproject.com/ticket/24662#comment:5>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.8f80861d3a4bbc96e32a7e9aa90dc0de%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to