Issue 1:
Migrated issue, originally created by Anonymous

The following field/index produces an error in SA 0.4.2 / MySQL 5:

table = sa.Table('resource_path', self.db_metadata,
sa.Column('id', sa.Integer, primary_key = True),
sa.Column('path', sa.Binary(255), index = True),
mysql_engine='INNODB'
)
table.create(checkfirst = True)

The complete error message is:

Traceback (most recent call last):
File "Guard/DBTest.py", line 43, in setUp
self.assert_(self.db.install())
File "/home/sam/code/spiff_guard/tests/Guard/../../src/Guard/DB.py",
line 35, in install
table.create(checkfirst = True)
File "/var/lib/python-support/python2.5/sqlalchemy/schema.py", line 300, in create
self.metadata.create_all(bind=bind, checkfirst=checkfirst,
tables=[self](self))
File "/var/lib/python-support/python2.5/sqlalchemy/schema.py", line 1215, in create_all
bind.create(self, checkfirst=checkfirst, tables=tables)
File "/var/lib/python-support/python2.5/sqlalchemy/engine/base.py", line 1131, in create
self._run_visitor(self.dialect.schemagenerator, entity, connection=connection, **kwargs)
File "/var/lib/python-support/python2.5/sqlalchemy/engine/base.py", line 1160, in _run_visitor
visitorcallable(self.dialect, conn, **kwargs).traverse(element)
File "/var/lib/python-support/python2.5/sqlalchemy/sql/visitors.py", line 76, in traverse
meth(target)
File "/var/lib/python-support/python2.5/sqlalchemy/sql/compiler.py", line 760, in visit_metadata
self.traverse_single(table)
File "/var/lib/python-support/python2.5/sqlalchemy/sql/visitors.py", line 30, in traverse_single
return meth(obj, **kwargs)
File "/var/lib/python-support/python2.5/sqlalchemy/sql/compiler.py", line 796, in visit_table
self.traverse_single(index)
File "/var/lib/python-support/python2.5/sqlalchemy/sql/visitors.py", line 30, in traverse_single
return meth(obj, **kwargs)
File "/var/lib/python-support/python2.5/sqlalchemy/sql/compiler.py", line 881, in visit_index
self.execute()
File "/var/lib/python-support/python2.5/sqlalchemy/engine/base.py", line 1760, in execute
return self.connection.execute(self.buffer.getvalue())
File "/var/lib/python-support/python2.5/sqlalchemy/engine/base.py", line 844, in execute
return Connection.executors[c](c)(self, object, multiparams, params)
File "/var/lib/python-support/python2.5/sqlalchemy/engine/base.py", line 854, in _execute_text
self.__execute_raw(context)
File "/var/lib/python-support/python2.5/sqlalchemy/engine/base.py", line 916, in __execute_raw
self._cursor_execute(context.cursor, context.statement, context.parameters[0](0), context=context)
File "/var/lib/python-support/python2.5/sqlalchemy/engine/base.py", line 953, in _cursor_execute
self._handle_dbapi_exception(e, statement, parameters, cursor)
File "/var/lib/python-support/python2.5/sqlalchemy/engine/base.py", line 935, in _handle_dbapi_exception
raise exceptions.DBAPIError.instance(statement, parameters, e, connection_invalidated=is_disconnect)
OperationalError: (OperationalError) (1170, "BLOB/TEXT column 'path' used in key specification without a key length") 'CREATE INDEX
ix_guard_resource_path_path ON guard_resource_path (path)' {}

The same thing happens when using Index() explicitly. The same table specification works in SA 0.3.

Issue 2:
Migrated issue, originally created by Anonymous

This MAY be related to changes in #965, however, I had to make the following change. The program worked without change with 4.0.0. The same problem shows up in 0.4.2b, and possibly earlier versions.

The traceback:

File "/usr/lib/python2.3/site-packages/SQLAlchemy-0.4.2p3-py2.3.egg/sqlalchemy/orm/init.py", line 544, in mapper

return Mapper(class_, local_table, *args, **params)

File "/usr/lib/python2.3/site-packages/SQLAlchemy-0.4.2p3-py2.3.egg/sqlalchemy/orm/mapper.py", line 160, in init

self._compile_pks()

File "/usr/lib/python2.3/site-packages/SQLAlchemy-0.4.2p3-py2.3.egg/sqlalchemy/orm/mapper.py", line 416, in _compile_pks

if t.primary_key and pk_cols.issuperset(t.primary_key):

File "/usr/lib/python2.3/sets.py", line 318, in issuperset

self._binary_sanity_check(other)

File "/usr/lib/python2.3/sets.py", line 343, in _binary_sanity_check

raise TypeError, "Binary operation only permitted between sets"

TypeError: Binary operation only permitted between sets

The change will be added as a file.

Attachments: y.patch