since nobody is replying to this you might want to post a trac ticket.
On May 21, 2008, at 4:56 PM, Samuel wrote:
>
> Hi,
>
> I am migrating a project from SA 0.3 to SA 0.4 and the following
> field/
> index produces an error:
>
> 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'
> )
>
> 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])
> 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](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], 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 table specification works in SA 0.3. Any idea?
>
> -Samuel
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---