Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-12156

HQL concat(varchar, int) not working on Sybase and SQL Server

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Major Major
    • None
    • 7.1.0.ER2
    • Hibernate

      This can be reproduced by running WithClauseTest#testWithClauseAsSubqueryWithKeyAndOtherJoinReference on an affected DB vendor.

      The problematic query: https://github.com/hibernate/hibernate-orm/blob/5.1.8/hibernate-core/src/test/java/org/hibernate/test/hql/WithClauseTest.java#L250

      concat('son', friend.intValue) translates into SQL 'son'+human2_.intValue, but on MS SQL this fails with

      Conversion failed when converting the varchar value 'son' to data type int.
      

      and on Sybase with

      Implicit conversion from datatype 'VARCHAR' to 'INT' is not allowed.  Use the CONVERT function to run this query.
      

              gbadner@redhat.com Gail Badner (Inactive)
              jmartisk@redhat.com Jan Martiska
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: