Ticket #982 (assigned defect)
Changing fields to null=True fails on MySql InnoDB
|Reported by:||klaas@…||Owned by:||andrew|
I've noticed that changing fields to null=True and then running the automatic south migrations fails on InnoDB.
... File "/Users/xxx/Sites/online_virtualenv/lib/python2.7/site-packages/MySQLdb/cursors.py", line 174, in execute self.errorhandler(self, exc, value) File "/Users/xxx/Sites/online_virtualenv/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler raise errorclass, errorvalue _mysql_exceptions.OperationalError: (1005, "Can't create table 'demo.#sql-1b9_2e' (errno: 121)")
This inconsistently (unfortunately) happens on various Ubuntu & MacOS setups.
MacOs Ver. 14.14 Distrib 5.5.14 failed for me today.
Funny thing is, that even though this error is raised, the mentioned field is actually made nullable in the DB. So commenting out the offending line in the migration and rerunning it fixes it.
InnoDB error log doesn't show much interesting info.
120106 13:05:56 [Warning] Invalid (old?) table or database name '#sql-1b9_2e'