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

Localized VARCHAR2 fields can exceed their maximum length

    Details

    • Branch Version/s:
      6.2.x, 6.1.x
    • Backported to Branch:
      Committed
    • Story Points:
      14
    • Databases:
      Oracle Database 10.1, Oracle Database 10.2, Oracle Database 11.1, Oracle Database 11.2, SQL Server 2005, SQL Server 2008, SQL Server 2008 R2, SQL Server 2012

      Description

      1. Start the portal on Oracle database
      2. Add a Basic web content, fill in the Title and Content fields
      3. Click on the Abstract tab and add text to the Summary field that is longer than 4000 characters (you can copy the example from the attached file)
      4. Try saving the article, you won't be able as warned by the client side validator logic, due to the too long value
      5. Delete characters from the entered text so that it's a little bit shorter than 4000 characters, and try saving again

      Result: You will get an error message and an exception in the log with ORA-01461 error.

      The cause of the issue is that the Summary field is localized which means we can set different translations for it. This is done by putting it into an XML context that holds the localization information before storing it. Because of this additional text being added to the value at the server side, it will exceed the VARCHAR2(4000) limit that is the type of the database column, and will be automatically converted to LONG by JDBC, but the database will not be able to handle this "cast" and throw the error.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

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

                  Packages

                  Version Package
                  6.1.X EE
                  6.2.2 CE GA3
                  6.2.4 CE GA5
                  6.2.X EE
                  7.0.0 M1