#16592: In MySQL, table names in unmanaged intermediate models are being lower
cased
------------------------------------+-----------------------------------
Reporter: jsdalton | Owner: nobody
Type: Bug | Status: new
Milestone: | Component: Testing framework
Version: SVN | Severity: Normal
Resolution: | Keywords: mysql
Triage Stage: Accepted | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------+-----------------------------------
Comment (by jsdalton):
Okay, there are two things at work here. I believe it is likely they are
only an issue if you have lower_case_table_names in MySQL set to 2.
The problem is:
* When you execute a CREATE INDEX command, it changes the table name to
lower case. For real. It's a known bug:
http://bugs.mysql.com/bug.php?id=48875 . Given that its' been open since
2009 it doesn't look like they are in any hurry to fix it.
* When you execute an ALTER TABLE ... AUTO_INCREMENT=1 statement, the
table name is changed to whatever case you use in the statement. For real.
So what actually happens here, on my set up:
1. All those tables from unmanaged models get created as UPPER CASE.
2. When the CREATE INDEX command is run on each of them in the latter part
of syncdb, they get converted to lower case.
3. During sqlflush The AUTO INCREMENT reset is applied only to a01, b01,
and c01, since d01 is an exception (an m2m using an intermediate table).
I don't know if the ALTER TABLE behavior is a bug or not (seems like one)
but in either case there's a lot of table name changing going on, and in a
sense it's just dumb luck that it works right most of the time.
I'll think about a solution.
--
Ticket URL: <https://code.djangoproject.com/ticket/16592#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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.