diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-08-02 01:12:03 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-08-02 01:12:03 -0400 |
commit | b2c0b50bbfa43f662afd16b7ca51bcfe17e4c351 (patch) | |
tree | d98573e0d6ed5308cde1c6aa32709afa86f0d7fc /test/dialect/test_mysql.py | |
parent | 2f844f231cbcd86dad5d4094565858424ea2c3c7 (diff) | |
download | sqlalchemy-b2c0b50bbfa43f662afd16b7ca51bcfe17e4c351.tar.gz |
- The generated index name also is based on
a "max index name length" attribute which is
separate from the "max identifier length" -
this to appease MySQL who has a max length
of 64 for index names, separate from their
overall max length of 255. [ticket:1412]
Diffstat (limited to 'test/dialect/test_mysql.py')
-rw-r--r-- | test/dialect/test_mysql.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/test/dialect/test_mysql.py b/test/dialect/test_mysql.py index 791a93c6e..7c4cc2309 100644 --- a/test/dialect/test_mysql.py +++ b/test/dialect/test_mysql.py @@ -1212,7 +1212,24 @@ class SQLTest(TestBase, AssertsCompiledSQL): self.assert_compile( select([extract('milliseconds', t.c.col1)]), "SELECT EXTRACT(millisecond FROM t.col1) AS anon_1 FROM t") - + + def test_too_long_index(self): + exp = 'ix_zyrenian_zyme_zyzzogeton_zyzzogeton_zyrenian_zyme_zyz_5cd2' + tname = 'zyrenian_zyme_zyzzogeton_zyzzogeton' + cname = 'zyrenian_zyme_zyzzogeton_zo' + + t1 = Table(tname, MetaData(), + Column(cname, Integer, index=True), + ) + ix1 = list(t1.indexes)[0] + + self.assert_compile( + schema.CreateIndex(ix1), + "CREATE INDEX %s " + "ON %s (%s)" % (exp, tname, cname), + dialect=mysql.dialect() + ) + def test_innodb_autoincrement(self): t1 = Table('sometable', MetaData(), Column('assigned_id', Integer(), primary_key=True, autoincrement=False), |