Skip to content

Commit bcfae21

Browse files
VladoKurucbeikov
authored andcommitted
HHH-18168 Skip test for older Informix
1 parent dcbb664 commit bcfae21

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

hibernate-core/src/test/java/org/hibernate/orm/test/hql/ASTParserLoadingTest.java

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,7 @@ public void testSelectClauseCaseWithSum(SessionFactoryScope scope) {
747747

748748
@Test
749749
@JiraKey(value = "HHH-4150")
750+
@SkipForDialect( dialectClass = InformixDialect.class, majorVersion = 11, minorVersion = 70, reason = "Informix does not support case with count distinct")
750751
public void testSelectClauseCaseWithCountDistinct(SessionFactoryScope scope) {
751752
scope.inTransaction(
752753
session -> {
@@ -3643,19 +3644,21 @@ public void testEJBQLFunctions(SessionFactoryScope scope) {
36433644
hql = "select length(a.description) from Animal a";
36443645
session.createQuery( hql ).list();
36453646

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();
3647+
Dialect dialect = session.getDialect();
3648+
// Informix before version 12 didn't support finding the index of substrings
3649+
if ( !(dialect instanceof InformixDialect && dialect.getVersion().isBefore( 12 )) ) {
3650+
//note: postgres and db2 don't have a 3-arg form, it gets transformed to 2-args
3651+
hql = "from Animal a where locate('abc', a.description, 2) = 2";
3652+
session.createQuery( hql ).list();
36503653

3651-
hql = "from Animal a where locate('abc', a.description) = 2";
3652-
session.createQuery( hql ).list();
3654+
hql = "from Animal a where locate('abc', a.description) = 2";
3655+
session.createQuery( hql ).list();
36533656

3654-
hql = "select locate('cat', a.description, 2) from Animal a";
3655-
session.createQuery( hql ).list();
3656-
}
3657+
hql = "select locate('cat', a.description, 2) from Animal a";
3658+
session.createQuery( hql ).list();
3659+
}
36573660

3658-
if ( !(session.getDialect() instanceof DB2Dialect) ) {
3661+
if ( !(dialect instanceof DB2Dialect) ) {
36593662
hql = "from Animal a where trim(trailing '_' from a.description) = 'cat'";
36603663
session.createQuery( hql ).list();
36613664

@@ -3669,7 +3672,7 @@ public void testEJBQLFunctions(SessionFactoryScope scope) {
36693672
session.createQuery( hql ).list();
36703673
}
36713674

3672-
if ( !(session.getDialect() instanceof HSQLDialect) ) { //HSQL doesn't like trim() without specification
3675+
if ( !(dialect instanceof HSQLDialect) ) { //HSQL doesn't like trim() without specification
36733676
hql = "from Animal a where trim(a.description) = 'cat'";
36743677
session.createQuery( hql ).list();
36753678
}
@@ -3728,6 +3731,7 @@ public void testOrderByExtraParenthesis(SessionFactoryScope scope) throws Except
37283731
}
37293732
}
37303733

3734+
@Test
37313735
@RequiresDialectFeature(
37323736
feature = DialectFeatureChecks.SupportSubqueryAsLeftHandSideInPredicate.class,
37333737
comment = "Database does not support using subquery as singular value expression"

0 commit comments

Comments
 (0)