Re: [SQLObject] alternateID & StringCol & mysql
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: jonhattan <jon...@op...> - 2007-11-08 18:03:42
|
Oleg Broytmann escribió: > On Thu, Nov 08, 2007 at 03:22:20PM +0000, jonhattan wrote: > >> sqlobject.dberrors.OperationalError: BLOB/TEXT column 'nombre' used in >> key specification without a key length >> >> It fixs adding length to the params. >> >> In postgres it does not complain. >> > > Without looking into the MySQL and Postgres docs I guess MySQL doesn't > allow TEXT columns to be unique (alternateId implies uniqueness). > If it's so there is not much SQLObject can do about this. > > Oleg. > I found the problem is that mysql does not support keys more than 1000 bytes[1]. A workaround could be to set a length of 1000 if no length is specified and alternateId is present. 1000 for StringCol, 333 for UnicodeCol (1000 bytes / 3 bytes * char) http://bugs.mysql.com/bug.php?id=4541 |