Uploaded image for project: 'JBoss Enterprise Application Platform 6'
  1. JBoss Enterprise Application Platform 6
  2. JBPAPP6-1221

HHH-6655 TemplateRenderer and CriteriaQueryBuilder.TrimSpec behaves differently for DB2 causing querybuilder.trim test in JPA2 TCK to fail

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: EAP 6.0.0 DR 2
    • Fix Version/s: EAP 6.1.0
    • Component/s: Hibernate
    • Labels:
      None

      Description

      https://hibernate.onjira.com/browse/HHH-6655

      Failing test:com.sun.ts.tests.ejb30.persistence.criteriaapi.querybuilder.Client
      testname=trim

      For DB2 a warning message is generated by TempateRenderer which is not seen for other databases:
      WARN: HHH00174:Function template anticipated 3 arguments, but 2 arguments encountered

      Also the query created is different in case of DB2:
      Hibernate: select replace(replace(ltrim(rtrim(replace(replace(customer0_.NAME,' ','${space}$'),?,' '))),' ',?),'${space}$',' ') as col_0_0_ from CUSTOMER_TABLE customer0_ where customer0_.NAME=? fetch first 2 rows only

      and finally it fails because of above warning:

      javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: DB2 SQL Error: SQLCODE=-313, SQLSTATE=07001

      For other DBs same code generates following query and test passes:

      Hibernate: select trim(BOTH ? from customer0_.NAME) as col_0_0_ from CUSTOMER_TABLE customer0_ where customer0_.NAME=? limit ?

      Attaching log and testcode

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  brmeyer Brett Meyer
                  Reporter:
                  madhumita12 Madhumita Sadhukhan
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: