|
28 | 28 | import org.hibernate.TypeMismatchException; |
29 | 29 | import org.hibernate.cfg.Configuration; |
30 | 30 | import org.hibernate.cfg.Environment; |
| 31 | +import org.hibernate.community.dialect.InformixDialect; |
31 | 32 | import org.hibernate.dialect.AbstractHANADialect; |
32 | 33 | import org.hibernate.dialect.CockroachDialect; |
33 | 34 | import org.hibernate.dialect.DB2Dialect; |
@@ -3665,15 +3666,17 @@ public void testEJBQLFunctions() throws Exception { |
3665 | 3666 | hql = "select length(a.description) from Animal a"; |
3666 | 3667 | session.createQuery(hql).list(); |
3667 | 3668 |
|
3668 | | - //note: postgres and db2 don't have a 3-arg form, it gets transformed to 2-args |
3669 | | - hql = "from Animal a where locate('abc', a.description, 2) = 2"; |
3670 | | - session.createQuery(hql).list(); |
| 3669 | + if ( !( getDialect() instanceof InformixDialect && getDialect().getVersion().isBefore( 12 ) ) ) { |
| 3670 | + //note: postgres and db2 don't have a 3-arg form, it gets transformed to 2-args |
| 3671 | + hql = "from Animal a where locate('abc', a.description, 2) = 2"; |
| 3672 | + session.createQuery( hql ).list(); |
3671 | 3673 |
|
3672 | | - hql = "from Animal a where locate('abc', a.description) = 2"; |
3673 | | - session.createQuery(hql).list(); |
| 3674 | + hql = "from Animal a where locate('abc', a.description) = 2"; |
| 3675 | + session.createQuery( hql ).list(); |
3674 | 3676 |
|
3675 | | - hql = "select locate('cat', a.description, 2) from Animal a"; |
3676 | | - session.createQuery(hql).list(); |
| 3677 | + hql = "select locate('cat', a.description, 2) from Animal a"; |
| 3678 | + session.createQuery( hql ).list(); |
| 3679 | + } |
3677 | 3680 |
|
3678 | 3681 | if ( !( getDialect() instanceof DB2Dialect ) ) { |
3679 | 3682 | hql = "from Animal a where trim(trailing '_' from a.description) = 'cat'"; |
|
0 commit comments