|
11 | 11 | import org.hibernate.ScrollableResults; |
12 | 12 | import org.hibernate.TypeMismatchException; |
13 | 13 | import org.hibernate.cfg.Environment; |
| 14 | +import org.hibernate.community.dialect.InformixDialect; |
14 | 15 | import org.hibernate.community.dialect.DerbyDialect; |
15 | 16 | import org.hibernate.dialect.CockroachDialect; |
16 | 17 | import org.hibernate.dialect.DB2Dialect; |
@@ -3642,15 +3643,17 @@ public void testEJBQLFunctions(SessionFactoryScope scope) { |
3642 | 3643 | hql = "select length(a.description) from Animal a"; |
3643 | 3644 | session.createQuery( hql ).list(); |
3644 | 3645 |
|
3645 | | - //note: postgres and db2 don't have a 3-arg form, it gets transformed to 2-args |
3646 | | - hql = "from Animal a where locate('abc', a.description, 2) = 2"; |
3647 | | - session.createQuery( hql ).list(); |
| 3646 | + if ( !( getDialect() instanceof InformixDialect && getDialect().getVersion().isBefore( 12 ) ) ) { |
| 3647 | + //note: postgres and db2 don't have a 3-arg form, it gets transformed to 2-args |
| 3648 | + hql = "from Animal a where locate('abc', a.description, 2) = 2"; |
| 3649 | + session.createQuery( hql ).list(); |
3648 | 3650 |
|
3649 | | - hql = "from Animal a where locate('abc', a.description) = 2"; |
3650 | | - session.createQuery( hql ).list(); |
| 3651 | + hql = "from Animal a where locate('abc', a.description) = 2"; |
| 3652 | + session.createQuery( hql ).list(); |
3651 | 3653 |
|
3652 | | - hql = "select locate('cat', a.description, 2) from Animal a"; |
3653 | | - session.createQuery( hql ).list(); |
| 3654 | + hql = "select locate('cat', a.description, 2) from Animal a"; |
| 3655 | + session.createQuery( hql ).list(); |
| 3656 | + } |
3654 | 3657 |
|
3655 | 3658 | if ( !(session.getDialect() instanceof DB2Dialect) ) { |
3656 | 3659 | hql = "from Animal a where trim(trailing '_' from a.description) = 'cat'"; |
|
0 commit comments