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

Clobs cannot be used in an ORDER BY comparison in SQLServer

    Details

      Description

      Description
      When using a CLOB data type in an order by comparator, we need to cast it. In Hibernate's parsing to parse the query, they can often remove the space after the casting call and the asc. This is not normally a problem, however Hibernate uses the current Dialect's getLimitString function in order to get the string used to work with sorting results. However our implementation of getLimitString (SQLServerLimitStringUtil depends on looking for the last space in order to parse out the ASC/DESC operators. However since the Util takes into account both inner and outer order bys, it is unsure if a simple substring compare will not cause more bugs to occur).

      Steps to Reproduce

      1. Run DataLayoutResourceTest.testGetDataDefinitionDataLayoutsPageWithSortString on SQLServer

      Expected Result
      Test passes

      Actual Result
      Test fails because Hibernate cannot parse the SQL due to SQLServerLimitStringUtil appending an extra ASC

      Tested on Tomcat 9.0.17 + SQL Server 2019
      Portal master GIT ID: cd88252c3891fd40e757e2c658ef6c1c7b257f9a

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              hai.yu Hai Yu
              Reporter:
              kyle.miho Kyle Miho
              Participants of an Issue:
              Recent user:
              Hai Yu
              Engineering Assignee:
              Hai Yu
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                3 weeks, 6 days ago

                  Packages

                  Version Package