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