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

"Description" field data of LayoutPrototype table is too long for column size

    Details

      Description

      Upgrade of fields description (and name) of Layoutprototype table makes the following exception be thrown by every module that uses it:

      ERROR [localhost-startStop-1][com_liferay_portal_upgrade:97] Invocation to listener threw exception 
      java.lang.RuntimeException: com.liferay.portal.kernel.upgrade.UpgradeException: com.microsoft.sqlserver.jdbc.SQLServerException: String or binary data would be truncated.
      [...]
      Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: String or binary data would be truncated.
       at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216)
       at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1515)
       at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:404)
       at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:350)
       at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696)
       at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715)
       at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:180)
       at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:155)
       at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate(SQLServerPreparedStatement.java:314)
       at org.apache.tomcat.dbcp.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:97)
       at org.apache.tomcat.dbcp.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:97)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:498)
       at com.liferay.portal.upgrade.dao.orm.DefaultUpgradeOptimizedPreparedStatementHandler.invoke(DefaultUpgradeOptimizedPreparedStatementHandler.java:50)
       at com.sun.proxy.$Proxy340.executeUpdate(Unknown Source)
       at com.liferay.portal.kernel.upgrade.BaseUpgradeLocalizedColumn._upgrade(BaseUpgradeLocalizedColumn.java:102)
       at com.liferay.portal.kernel.upgrade.BaseUpgradeLocalizedColumn.upgradeLocalizedColumn(BaseUpgradeLocalizedColumn.java:51)
       at com.liferay.wiki.layout.prototype.internal.upgrade.v1_0_0.UpgradeLocalizedColumn.doUpgrade(UpgradeLocalizedColumn.java:34)
      

       Tested with SQL Server 2016. Description and name fields are defined for this DB as a nvarchar(2000) data type, and these fields are going to be likely bigger than 2000 characters after the internationalization included in --LPS-72169--.

      Steps to reproduce:

      1. Install a clean bundle with fixpack-36 applied.
      2. Start the portal using SQL Server
      3. Notice the log errors related with LayoutPrototype table.

      Expected result :

      3. The portal starts without any errors.

      Current result : 

      3. Exceptions related with the LayoutPrototype table are thrown by several modules.

      This should be tested against all supported databases.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  1 year, 42 weeks, 5 days ago

                  Packages

                  Version Package
                  7.0.0 DXP FP40
                  7.0.0 DXP SP7
                  7.0.5 CE GA6
                  7.0.X
                  7.1.0 M1
                  7.1.X
                  Master