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

Upgrade SQL syntax error when username has an apostrophe and has uploaded images to gallery

    Details

      Description

      STEPS TO REPRODUCE:
      1. Create a 6.0.10 clean database.
      2. Create a user named Pre'First Last and the ability to upload images. (In my test case I used "Lo'Rita Vargas" and set her as admin)
      3. Login as new user. Impersonate is fine.
      4. Upload images to image gallery. Create one bookmark.
      5. Upgrade to trunk.

      18:52:57,887 INFO [UpgradeProcess:205] Upgrading com.liferay.portal.upgrade.v6_1_0.UpgradeUserName
      18:52:57,904 ERROR [MainServlet:197] com.liferay.portal.kernel.events.ActionException: com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.upgrade.UpgradeException: com.mysql.jdbc.exceptions.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 'First Last' where userId = 10280' at line 1
      com.liferay.portal.kernel.events.ActionException: com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.upgrade.UpgradeException: com.mysql.jdbc.exceptions.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 'First Last' where userId = 10280' at line 1
      at com.liferay.portal.events.StartupAction.run(StartupAction.java:58)
      at com.liferay.portal.servlet.MainServlet.processStartupEvents(MainServlet.java:1264)
      at com.liferay.portal.servlet.MainServlet.init(MainServlet.java:194)
      at javax.servlet.GenericServlet.init(GenericServlet.java:160)
      at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1228)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1147)
      at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1043)
      at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4957)
      at org.apache.catalina.core.StandardContext$3.call(StandardContext.java:5284)
      at org.apache.catalina.core.StandardContext$3.call(StandardContext.java:5279)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:680)
      Caused by: com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.upgrade.UpgradeException: com.mysql.jdbc.exceptions.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 'First Last' where userId = 10280' at line 1
      at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:211)
      at com.liferay.portal.upgrade.UpgradeProcessUtil._upgradeProcess(UpgradeProcessUtil.java:93)
      at com.liferay.portal.upgrade.UpgradeProcessUtil.upgradeProcess(UpgradeProcessUtil.java:46)
      at com.liferay.portal.events.StartupHelper.upgradeProcess(StartupHelper.java:73)
      at com.liferay.portal.events.StartupHelperUtil.upgradeProcess(StartupHelperUtil.java:40)
      at com.liferay.portal.tools.DBUpgrader.upgrade(DBUpgrader.java:112)
      at com.liferay.portal.events.StartupAction.doRun(StartupAction.java:144)
      at com.liferay.portal.events.StartupAction.run(StartupAction.java:52)
      ... 14 more
      Caused by: com.liferay.portal.kernel.upgrade.UpgradeException: com.mysql.jdbc.exceptions.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 'First Last' where userId = 10280' at line 1
      at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:211)
      at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:227)
      at com.liferay.portal.upgrade.UpgradeProcess_6_1_0.doUpgrade(UpgradeProcess_6_1_0.java:60)
      at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:208)
      ... 21 more
      Caused by: com.mysql.jdbc.exceptions.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 'First Last' where userId = 10280' at line 1
      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
      at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
      at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
      at com.mysql.jdbc.Connection.execSQL(Connection.java:3250)
      at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1355)
      at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1270)
      at com.mchange.v2.c3p0.impl.NewProxyStatement.executeUpdate(NewProxyStatement.java:64)
      at com.liferay.portal.dao.db.BaseDB.runSQL(BaseDB.java:237)
      at com.liferay.portal.dao.db.BaseDB.runSQL(BaseDB.java:204)
      at com.liferay.portal.dao.db.BaseDB.runSQL(BaseDB.java:191)
      at com.liferay.portal.kernel.upgrade.UpgradeProcess.runSQL(UpgradeProcess.java:115)
      at com.liferay.portal.upgrade.v6_1_0.UpgradeUserName.updateTable(UpgradeUserName.java:107)
      at com.liferay.portal.upgrade.v6_1_0.UpgradeUserName.doUpgrade(UpgradeUserName.java:34)
      at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:208)
      ... 24 more
      Stopping the server due to unexpected startup errors

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                michael.saechang Michael Saechang
                Reporter:
                caleb.fong Caleb Fong (Inactive)
                Participants of an Issue:
                Recent user:
                Esther Sanz
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

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

                  Packages

                  Version Package
                  6.0.X EE
                  6.1.0 CE RC1