]> 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)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 8 Jun 2013 18:54:42 +0000 (14:54 -0400)
commit1b231ff271077235b9d30489633aa3359792f723
treed443054161bba596432f6941e027e8dc303d2673
parent45f8ff88c9209374586062d536735e484014d665
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