Menu

#121 MySQL 4.0/SQLObject-0.7.0 barfs on alternateID=True

closed-invalid
nobody
MySQL (29)
5
2005-10-28
2005-10-25
No

When I try to do a create (with TurboGears,
incidentally) on an SQLObject like so:

class x(SQLObject):
name = StringCol(alternateID=True)

this turns into SQL like

1/Query : CREATE TABLE x (
id INT PRIMARY KEY AUTO_INCREMENT,
name TEXT NOT NULL UNIQUE );

which causes mysql to barf with

_mysql_exceptions.OperationalError: (1170, "BLOB column
'name' used in key specification without a key length")

I don't know the issues well enough to understand what
should happen here. If this works in newer mysql
versions, at least 4.0 ought to be documented as too old.

Discussion

  • Oleg Broytman

    Oleg Broytman - 2005-10-25

    Logged In: YES
    user_id=4799

    Try name = StringCol(length=255, alternateID=True)

     
  • Mike Coleman

    Mike Coleman - 2005-10-25

    Logged In: YES
    user_id=555

    Thanks phd, this does seem to work, at the cost of limiting
    the length of this field.

    Perhaps this can be added to the "mysql gotchas" section...

     
  • Oleg Broytman

    Oleg Broytman - 2005-10-28
    • status: open --> closed-invalid
     

Log in to post a comment.