#10358: manage.py sqlall is not truncating long table names for ManyToManyField ------------------------------------+--------------------------------------- Reporter: jb0t | Owner: jacob Status: closed | Milestone: 1.1 Component: Documentation | Version: 1.0 Resolution: fixed | Keywords: Stage: Accepted | Has_patch: 1 Needs_docs: 0 | Needs_tests: 0 Needs_better_patch: 0 | ------------------------------------+--------------------------------------- Comment (by ramiro):
Actually, the note added to the docs is incorrect, as it was the content it replaced. Django doesn't set a hard limit of 64 nor 32 characters on the names of the auto-generated m2m intermediary tables, is simply uses the max identifier length (provided by a `DatabaseOperations.max_name_length()` method) reported by the backend, if any. The Django MySQL DB backend doesn't define `max_name_length()` and because of that the ORM machinery doesn't truncate the m2m table name at all. I suspect what the OP was seeing is MySQL showing its 64 chars limitation (a comment in the Django source seems to indicate that MySQL doesn't have a hard limit on the length of identifiers, but rather it only considers the first 64 chars to discern among them, I couldn't confirm this). In contrast, in the Oracle case the RDBMS identifier hard limit is 30, this is correctly reported by the Django DB backend and so an identifier of length > 30 will get converted to a 30 char identifier composed of the original 26 first chars plus 4 chars of and MD5 hash. Because of the above, IMHO the current note lacks generality and is a bit misleading even in the case of MySQL. -- Ticket URL: <http://code.djangoproject.com/ticket/10358#comment:7> Django <http://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 post to this group, send email to django-updates@googlegroups.com To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-updates?hl=en -~----------~----~----~----~------~----~------~--~---