[ 
https://issues.apache.org/jira/browse/CONNECTORS-887?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13897039#comment-13897039
 ] 

Karl Wright commented on CONNECTORS-887:
----------------------------------------

Was able to reproduce.

{code}
org.apache.manifoldcf.core.interfaces.ManifoldCFException: Database exception: 
SQLException doing query (42000): You have an error in your SQL syntax; check 
the manual that corresponds to your MySQL server version for the right syntax 
to use near 'REFERENCES authgroups(groupname) ON DELETE RESTRICT' at line 1
        at 
org.apache.manifoldcf.core.database.Database$ExecuteQueryThread.finishUp(Database.java:702)
        at 
org.apache.manifoldcf.core.database.Database.executeViaThread(Database.java:728)
        at 
org.apache.manifoldcf.core.database.Database.executeUncachedQuery(Database.java:762)
        at 
org.apache.manifoldcf.core.database.Database$QueryCacheExecutor.create(Database.java:1435)
        at 
org.apache.manifoldcf.core.cachemanager.CacheManager.findObjectsAndExecute(CacheManager.java:144)
        at 
org.apache.manifoldcf.core.database.Database.executeQuery(Database.java:191)
        at 
org.apache.manifoldcf.core.database.DBInterfaceMySQL.performModification(DBInterfaceMySQL.java:691)
        at 
org.apache.manifoldcf.core.database.DBInterfaceMySQL.performAlter(DBInterfaceMySQL.java:423)
        at 
org.apache.manifoldcf.core.database.BaseTable.performAlter(BaseTable.java:118)
        at 
org.apache.manifoldcf.authorities.authority.AuthorityConnectionManager.install(AuthorityConnectionManager.java:169)
        at 
org.apache.manifoldcf.authorities.system.ManifoldCF.installSystemTables(ManifoldCF.java:125)
        at 
org.apache.manifoldcf.crawler.system.ManifoldCF.installSystemTables(ManifoldCF.java:532)
        at 
org.apache.manifoldcf.crawler.system.CrawlerAgent.install(CrawlerAgent.java:115)
        at 
org.apache.manifoldcf.agents.agentmanager.AgentManager.registerAgent(AgentManager.java:146)
        at 
org.apache.manifoldcf.crawler.system.ManifoldCF.registerThisAgent(ManifoldCF.java:136)
        at 
org.apache.manifoldcf.jettyrunner.ManifoldCFJettyRunner.main(ManifoldCFJettyRunner.java:210)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have 
an error in your SQL syntax; check the manual that corresponds to your MySQL 
server version for the right syntax to use near 'REFERENCES 
authgroups(groupname) ON DELETE RESTRICT' at line 1
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

        at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
        at com.mysql.jdbc.Util.getInstance(Util.java:386)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3609)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3541)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2002)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2163)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2618)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2568)
        at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:842)
        at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:681)
        at 
org.apache.manifoldcf.core.database.Database.execute(Database.java:854)
        at 
org.apache.manifoldcf.core.database.Database$ExecuteQueryThread.run(Database.java:683)
{code}


> Database schema not updated properly
> ------------------------------------
>
>                 Key: CONNECTORS-887
>                 URL: https://issues.apache.org/jira/browse/CONNECTORS-887
>             Project: ManifoldCF
>          Issue Type: Bug
>          Components: Framework core
>    Affects Versions: ManifoldCF 1.5
>         Environment: MySQL database
>            Reporter: Florian Schmedding
>            Assignee: Karl Wright
>            Priority: Minor
>              Labels: database, easyfix
>             Fix For: ManifoldCF 1.5.1, ManifoldCF 1.6
>
>
> When running Manifold 1.6 the first time with an database schema from 
> Manifold 1.3 the schema is not updated properly. The SQL-command 
> "ALTER TABLE authconnections MODIFY groupname VARCHAR(32) NOT NULL REFERENCES 
> authgroups(groupname) ON DELETE RESTRICT"
> fails. It should instead add the column:
> "ALTER TABLE authconnections ADD groupname VARCHAR(32) NOT NULL REFERENCES 
> authgroups(groupname) ON DELETE RESTRICT"
> The next startup after executing the corrected SQL-statement succeeds.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to