Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-70768

SQL Syntax Exceptions when upgrading - 'PRIMARY on ListType'

    Description

    Steps to reproduce:

    1. Start Portal 6.1.2 CE GA3
    2. Upgrade portal to 7.0.2 GA3

    Expected Result: Drop Index succeeds

    Actual Result: Alter table task fails. (Full log and duplicate key query attached below.)

    Alter 1
     
    19:02:07,380 INFO  [main][LoggingTimer:70] Starting com.liferay.portal.kernel.upgrade.UpgradeProcess#alter
    19:02:07,404 WARN  [main][UpgradeProcess:350] Fallback to recreating the table
    java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'PRIMARY on ListType' at line 1_Query is:_drop index PRIMARY on ListType [Sanitized]
            at org.mariadb.jdbc.internal.SQLExceptionMapper.get(SQLExceptionMapper.java:138)
            at org.mariadb.jdbc.internal.SQLExceptionMapper.throwException(SQLExceptionMapper.java:106)
            at org.mariadb.jdbc.MySQLStatement.executeQueryEpilog(MySQLStatement.java:268)
            at org.mariadb.jdbc.MySQLStatement.execute(MySQLStatement.java:296)
            at org.mariadb.jdbc.MySQLStatement.executeUpdate(MySQLStatement.java:364)
            at org.mariadb.jdbc.MySQLStatement.executeUpdate(MySQLStatement.java:396)
            at com.liferay.portal.dao.db.BaseDB.runSQL(BaseDB.java:291)
            at com.liferay.portal.dao.db.BaseDB.runSQL(BaseDB.java:261)
            at com.liferay.portal.kernel.dao.db.BaseDBProcess.runSQL(BaseDBProcess.java:52)
            at com.liferay.portal.kernel.upgrade.UpgradeProcess.alter(UpgradeProcess.java:314)
            at com.liferay.portal.upgrade.v7_0_0.UpgradeListType.doUpgrade(UpgradeListType.java:27)
            at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:88)
            at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:115)
            at com.liferay.portal.upgrade.UpgradeProcess_7_0_0.doUpgrade(UpgradeProcess_7_0_0.java:83)
            at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:88)
            at com.liferay.portal.kernel.upgrade.util.UpgradeProcessUtil._upgradeProcess(UpgradeProcessUtil.java:175)
            at com.liferay.portal.kernel.upgrade.util.UpgradeProcessUtil.upgradeProcess(UpgradeProcessUtil.java:143)
            at com.liferay.portal.kernel.upgrade.util.UpgradeProcessUtil.upgradeProcess(UpgradeProcessUtil.java:125)
            at com.liferay.portal.events.StartupHelper.upgradeProcess(StartupHelper.java:164)
            at com.liferay.portal.events.StartupHelperUtil.upgradeProcess(StartupHelperUtil.java:81)
            at com.liferay.portal.tools.DBUpgrader.upgrade(DBUpgrader.java:157)
            at com.liferay.portal.tools.DBUpgrader.main(DBUpgrader.java:103)
    Caused by: org.mariadb.jdbc.internal.common.QueryException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'PRIMARY on ListType' at line 1_Query is:_drop index PRIMARY on ListType [Sanitized]
            at org.mariadb.jdbc.internal.mysql.MySQLProtocol.getResult(MySQLProtocol.java:995)
            at org.mariadb.jdbc.internal.mysql.MySQLProtocol.executeQuery(MySQLProtocol.java:1050)
            at org.mariadb.jdbc.internal.mysql.MySQLProtocol.executeQuery(MySQLProtocol.java:1030)
            at org.mariadb.jdbc.MySQLStatement.execute(MySQLStatement.java:289)
            ... 18 more
    
    
    Alter 2
     
    19:13:31,948 INFO  [main][LoggingTimer:70] Starting com.liferay.portal.kernel.upgrade.UpgradeProcess#alter
    19:13:31,972 WARN  [main][UpgradeProcess:350] Fallback to recreating the table
    java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'PRIMARY on LayoutBranch' at line 1_Query is:_drop index PRIMARY on LayoutBranch [Sanitized]
            at org.mariadb.jdbc.internal.SQLExceptionMapper.get(SQLExceptionMapper.java:138)
            at org.mariadb.jdbc.internal.SQLExceptionMapper.throwException(SQLExceptionMapper.java:106)
            at org.mariadb.jdbc.MySQLStatement.executeQueryEpilog(MySQLStatement.java:268)
            at org.mariadb.jdbc.MySQLStatement.execute(MySQLStatement.java:296)
            at org.mariadb.jdbc.MySQLStatement.executeUpdate(MySQLStatement.java:364)
            at org.mariadb.jdbc.MySQLStatement.executeUpdate(MySQLStatement.java:396)
            at com.liferay.portal.dao.db.BaseDB.runSQL(BaseDB.java:291)
            at com.liferay.portal.dao.db.BaseDB.runSQL(BaseDB.java:261)
            at com.liferay.portal.kernel.dao.db.BaseDBProcess.runSQL(BaseDBProcess.java:52)
            at com.liferay.portal.kernel.upgrade.UpgradeProcess.alter(UpgradeProcess.java:314)
            at com.liferay.portal.upgrade.v7_0_1.UpgradeLayoutBranch.doUpgrade(UpgradeLayoutBranch.java:27)
            at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:88)
            at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:115)
            at com.liferay.portal.upgrade.UpgradeProcess_7_0_1.doUpgrade(UpgradeProcess_7_0_1.java:43)
            at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:88)
            at com.liferay.portal.kernel.upgrade.util.UpgradeProcessUtil._upgradeProcess(UpgradeProcessUtil.java:175)
            at com.liferay.portal.kernel.upgrade.util.UpgradeProcessUtil.upgradeProcess(UpgradeProcessUtil.java:143)
            at com.liferay.portal.kernel.upgrade.util.UpgradeProcessUtil.upgradeProcess(UpgradeProcessUtil.java:125)
            at com.liferay.portal.events.StartupHelper.upgradeProcess(StartupHelper.java:164)
            at com.liferay.portal.events.StartupHelperUtil.upgradeProcess(StartupHelperUtil.java:81)
            at com.liferay.portal.tools.DBUpgrader.upgrade(DBUpgrader.java:157)
            at com.liferay.portal.tools.DBUpgrader.main(DBUpgrader.java:103)
    Caused by: org.mariadb.jdbc.internal.common.QueryException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'PRIMARY on LayoutBranch' at line 1_Query is:_drop index PRIMARY on LayoutBranch [Sanitized]
            at org.mariadb.jdbc.internal.mysql.MySQLProtocol.getResult(MySQLProtocol.java:995)
            at org.mariadb.jdbc.internal.mysql.MySQLProtocol.executeQuery(MySQLProtocol.java:1050)
            at org.mariadb.jdbc.internal.mysql.MySQLProtocol.executeQuery(MySQLProtocol.java:1030)
            at org.mariadb.jdbc.MySQLStatement.execute(MySQLStatement.java:289)
            ... 18 more
    

    Upgraded from:
    Tomcat 7.0.40 + MariaDB 10.1.20
    Portal 6.1.2 CE GA3

    Upgraded to:
    Tomcat 8.0.32 + MariaDB 10.1.20
    Portal 7.0.2 CE GA3

      Attachments

        Activity

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              2 years, 6 weeks, 6 days ago

              Packages

              Version Package