#20846: Increase contrib.auth's User.username length
------------------------------+------------------------------------
Reporter: ivoras@… | Owner: nobody
Type: New feature | Status: closed
Component: contrib.auth | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+------------------------------------
Comment (by adamchainz):
This patch breaks on MySQL installations using the {{{utf8mb4}}} charset,
because it breaks the index length limit - it comes out at a maximum of
254 * 4 = 1016 bytes whilst by default InnoDB can only index 767 bytes. I
found this because I am using utf8mb4 in django-mysql.
Django encourages using the utf8 charset (3 bytes per character - cannot
store emojis), although there has been some discussion for moving to
utf8mb4 in #18392. One can index 254 character utf8mb4 fields in MySQL by
using a couple settings as described in that ticket, Django could enforce
those, or the field coudl be changed to just 191 characters instead which
is the maximum indexable (767 // 4).
--
Ticket URL: <https://code.djangoproject.com/ticket/20846#comment:25>
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/074.05214499c82c75008196005d6eb909f9%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.