]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Fix using of 'mysql_length' for composite indexes
authorRoman Podolyaka <roman.podolyaka@gmail.com>
Sat, 8 Jun 2013 17:38:02 +0000 (20:38 +0300)
committerRoman Podolyaka <roman.podolyaka@gmail.com>
Sat, 8 Jun 2013 17:56:28 +0000 (20:56 +0300)
commit4cc9d482ae8edc2ac60aaf4102bab84148691fed
treea9908dd9af7db38f429c3db168896561cf43b467
parenta341e1ccc9b4d12906f8cb423c45ac2f6f754891
Fix using of 'mysql_length' for composite indexes

Currently, one can specify the prefix length for an index
column using 'mysql_length' keyword argument when creating
an Index instance. But in case of composite indexes the
prefix length value is applied only to the last column.

Extend the existing API in way so that 'mysql_length' argument
value can be either:
    - an integer specifying the same prefix length value
      for each column of an index
    - a (column_name --> integer value) mapping specifying
      the prefix length value for each column of an index
      separately

Fixes issue #2704.
lib/sqlalchemy/dialects/mysql/base.py
test/dialect/test_mysql.py