Incorrect table definition; there can be only one auto column and it must be defined as a key

457 views
Skip to first unread message

Régis Jean-Gilles

unread,
Feb 16, 2010, 4:42:05 AM2/16/10
to Fénix Framework
Hello.

I get the following exception when creating a fresh database, with
version r46008, and using MySQL 5.0.51a :

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Incorrect
table definition; there can be only one auto column and it must be
defined as a key
at sun.reflect.GeneratedConstructorAccessor6.newInstance(Unknown
Source)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:
27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.Util.getInstance(Util.java:381)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1031)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:957)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3376)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3308)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1837)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1961)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2537)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2466)
at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:735)
at
pt.ist.fenixframework.pstm.repository.RepositoryBootstrap.executeSqlInstructions(RepositoryBootstrap.java:
124)
at
pt.ist.fenixframework.pstm.repository.RepositoryBootstrap.updateDataRepositoryStructureIfNeeded(RepositoryBootstrap.java:
88)
at
pt.ist.fenixframework.FenixFramework.initialize(FenixFramework.java:
39)

It seems that there is a missing "primary key" in some
"auto_increment" column definition.

Oddly enough, this leaves the database half-created, and a second run
makes it work. This means that we can live with it for the time being.

Luis Cruz

unread,
Feb 16, 2010, 10:33:14 AM2/16/10
to fenix-f...@googlegroups.com
Hello,

This was due to the incomplete initialization of the PersistentRoot
after it was recently refactored. The issue is currently fixed as of
revision 46281.

Best regards,
Luis Cruz

Régis Jean-Gilles

unread,
Feb 16, 2010, 11:19:09 AM2/16/10
to Fénix Framework
Great, thank you.
Reply all
Reply to author
Forward
0 new messages