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

CustomSQLUtil.replaceOrderBy(...) doesn't handle ambiguous columns well

    Details

    • Type: Regression Bug
    • Status: Verified
    • Resolution: Unresolved
    • Affects Version/s: 6.2.0 CE M6
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Tomcat 7 + Oracle 11g. Portal 6.2.x GIT ID: 99035ed7944e8752049820916110d213922ad68d.

      Description

      Description

      Change introduced by LPS-33388 uses self join and thus makes some columns ambiguous this way. Some RDBMS implementations (eg. Oracle) need columns in the ORDER BY clause of queries to be prefixed with proper row-source aliases in order to make them unambiguous.

      Steps to reproduce

      1) Create a Web Content "WC1".
      2) Put the Web Content List portlet to the main page.
      3) Configure the portlet and choose ordering based on Date created.
      4) Observe the following exception on the console.

      09:07:27,231 ERROR [RuntimePageImpl-2][JDBCExceptionReporter:76] ORA-00918: column ambiguously defined
      
      May 2, 2013 9:07:27 AM org.apache.catalina.core.ApplicationDispatcher invoke
      SEVERE: Servlet.service() for servlet jsp threw exception
      java.sql.SQLSyntaxErrorException: ORA-00918: column ambiguously defined
      
      	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:445)
      	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
      	at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:879)
      	at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:450)
      	at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)
      	at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
      	at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:207)
      	at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:884)
      	at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1167)
      	at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1289)
      	at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3584)
      	at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3628)
      	at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1493)
      	at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76)
      	at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
      	at org.hibernate.loader.Loader.getResultSet(Loader.java:1953)
      	at org.hibernate.loader.Loader.doQuery(Loader.java:802)
      	at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
      	at org.hibernate.loader.Loader.doList(Loader.java:2542)
      	at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)
      	at org.hibernate.loader.Loader.list(Loader.java:2271)
      	at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:316)
      	at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1842)
      	at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
      	at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:157)
      	at com.liferay.portal.dao.orm.hibernate.SQLQueryImpl.list(SQLQueryImpl.java:120)
      	at com.liferay.portal.dao.orm.hibernate.SQLQueryImpl.list(SQLQueryImpl.java:112)
      	at com.liferay.portal.kernel.dao.orm.QueryUtil.list(QueryUtil.java:176)
      	at com.liferay.portal.kernel.dao.orm.QueryUtil.list(QueryUtil.java:161)
      	at com.liferay.portlet.journal.service.persistence.JournalArticleFinderImpl.doFindByC_G_F_C_A_V_T_D_C_T_S_T_D_R(JournalArticleFinderImpl.java:1356)
      	at com.liferay.portlet.journal.service.persistence.JournalArticleFinderImpl.filterFindByC_G_F_C_A_V_T_D_C_T_S_T_D_R(JournalArticleFinderImpl.java:441)
      	at com.liferay.portlet.journal.service.persistence.JournalArticleFinderImpl.filterFindByC_G_F_C_A_V_T_D_C_T_S_T_D_R(JournalArticleFinderImpl.java:425)
      	at com.liferay.portlet.journal.service.persistence.JournalArticleFinderImpl.filterFindByC_G_F_C_A_V_T_D_C_T_S_T_D_R(JournalArticleFinderImpl.java:404)
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                9 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Days since last comment:
                  5 years, 27 weeks, 2 days ago

                  Packages

                  Version Package