#28391: Cast doesn't take into account CharField's max_length on MySQL.
-------------------------------------+-------------------------------------
Reporter: felixxm | Owner: felixxm
Type: Bug | Status: assigned
Component: Database | Version: master
layer (models, ORM) |
Severity: Normal | Keywords: Cast
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Correct behavior, e.g. (based on `db_functions/test_cast.py`):
{{{
>>> Author.objects.create(name='Bob', age=1111)
>>> numbers = Author.objects.annotate(cast_string=Cast('age',
models.CharField(max_length=3)))
>>> numbers.get().cast_string
111
}}}
on MySQL it returns `1111` (related with #28371).
--
Ticket URL: <https://code.djangoproject.com/ticket/28391>
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/050.33b16ffe4d077a248f6d73dca37f50ed%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.