Uploaded image for project: 'Hibernate ORM'
  1. HHH-8188

Postgres Plus 9.2 - ambiguous column reference

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects versions: 4.2.0.Final
    • Fix versions: None
    • Components: None
    • Labels:
      None
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true
    • Sprint:

      Description

      We have a few test failures on Postgres Plus 9.2 due to a ambiguous column reference, in these tests:
      org.hibernate.test.hql.FunctionNameAsColumnTest.testGetMultiColumnSameNameAsArgFunctionCriteria
      org.hibernate.test.hql.FunctionNameAsColumnTest.testGetMultiColumnSameNameAsArgFunctionHQL
      org.hibernate.test.hql.FunctionNameAsColumnTest.testGetMultiColumnSameNameAsNoArgFunctionCriteria
      org.hibernate.test.hql.FunctionNameAsColumnTest.testGetMultiColumnSameNameAsNoArgFunctionHQL

      org.hibernate.test.hql.FunctionNameAsColumnTest.testNoArgFcnAndColumnSameNameAsNoArgFunctionHQL

      Eg. testGetMultiColumnSameNameAsArgFunctionCriteria:

      Stacktrace
      
      org.hibernate.exception.SQLGrammarException: could not extract ResultSet
      ...
      Caused by: com.edb.util.PSQLException: ERROR: column reference "lower" is ambiguous
        Position: 858
      

      the problem is in the generated query:

      select this_.ID as ID1_1_3_, this_.nextHolder as nextHold2_1_3_, entitywith2_.ID as ID1_1_0_, entitywith2_.nextHolder as nextHold2_1_0_, entitywith3_.HOLDER_ID as HOLDER4_1_5_, entitywith3_.ID as ID1_0_5_, entitywith3_.ID as ID1_0_1_, entitywith3_.lower as lower2_0_1_, entitywith3_.upper as upper3_0_1_, entitywith4_.HOLDER_ID as HOLDER4_1_6_, entitywith4_.ID as ID1_0_6_, entitywith4_.ID as ID1_0_2_, entitywith4_.lower as lower2_0_2_, entitywith4_.upper as upper3_0_2_ from ENTITY_WITH_FN_AS_COL_HOLDER this_ left outer join ENTITY_WITH_FN_AS_COL_HOLDER entitywith2_ on this_.nextHolder=entitywith2_.ID left outer join ENTITY_WITH_ARG_FN_AS_COL entitywith3_ on entitywith2_.ID=entitywith3_.HOLDER_ID left outer join ENTITY_WITH_ARG_FN_AS_COL entitywith4_ on this_.ID=entitywith4_.HOLDER_ID where this_.nextHolder is not null order by entitywith3_.lower, lower(entitywith3_.upper), entitywith4_.lower, lower(entitywith4_.upper)
      

      there is also comparison failure in testNoArgFcnAndColumnSameNameAsNoArgFunctionHQL, which I belive is caused by the same problem

      org.junit.ComparisonFailure: expected:<[yadda yadda yadda]> but was:<[blah blah blah]>
      

        Attachments

          Issue links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: