- changed milestone to 0.5.xx
Automatically generated index name is too long (MySQL)
I have a table definition like this:
Table( 'zyrenian_zyme_zyzzogeton_zyzzogeton', metadata, Column('zyrenian_zyme_zyzzogeton_zyrenian_zo', CHAR(36), primary_key=True), Column('zyrenian_zyme_zyzzogeton_zo', CHAR(36), nullable=False, index=True), mysql_engine='InnoDB')
When SA executes resulting DDL statements against a MySQL engine, I get this error:
sqlalchemy.exc.OperationalError: (OperationalError) (1059, "Identifier name 'ix_zyrenian_zyme_zyzzogeton_zyzzogeton_zyrenian_zyme_zyzzogeton_zo' is too long") u'CREATE INDEX ix_zyrenian_zyme_zyzzogeton_zyzzogeton_zyrenian_zyme_zyzzogeton_zo ON zyrenian_zyme_zyzzogeton_zyzzogeton (zyrenian_zyme_zyzzogeton_zo)'
To mitigate, I had to explicitly define an index with a shorter name.
Comments (5)
-
repo owner -
I'm not sure why
max_identifier_length = 255
for mysql. Sure Alias supports 256 characters but every other identifier supports 64. We should limit it to 64 unless someone wants to provide their own. Seems like the path of least problems.
-
repo owner I would assume this bug at this point is fixed by
#1855, if it weren't fixed already - the test above seems to not even include the_1
that would have occurred. We can give it a quick test perhaps to verify. -
repo owner apparently not. how very annoying. b2c0b50bbfa43f662afd16b7ca51bcfe17e4c351
-
repo owner - removed milestone
Removing milestone: 0.6.4 (automated comment)
- Log in to comment