#34863: sqlite math functions don't accept character fields as input
-------------------------------------+-------------------------------------
Reporter: Zachary Croker | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: 4.2
(models, ORM) |
Severity: Normal | Resolution: invalid
Keywords: sqlite, math | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Zachary Croker):
Replying to [comment:2 Mariusz Felisiak]:
> Thanks for this ticket, however `radians` should not accept strings. You
can cast values before passing them to this function.
Hi Mariusz, the sqlite docs specify that these functions should accept
strings (see https://www.sqlite.org/lang_mathfunc.html)
"The arguments to math functions can be integers, floating-point numbers,
or strings or blobs that look like integers or real numbers. If any
argument is NULL or is a string or blob that is not readily converted into
a number, then the function will return NULL."
Also - in this instance I am unable to cast the values because they are
calculated wholly within the view (which I can't change)
--
Ticket URL: <https://code.djangoproject.com/ticket/34863#comment:3>
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/0107018abf505043-37bb91f9-af20-4e1b-b709-2249522444b3-000000%40eu-central-1.amazonses.com.