Skip to content

Commit 4b90847

Browse files
committed
skip some tests for interval/datetime arithmetic on Informix
1 parent 60d2b69 commit 4b90847

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/FunctionTests.java

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,6 +1093,7 @@ public void testCastInvalidStringToBoolean(SessionFactoryScope scope) {
10931093
@SkipForDialect(dialectClass = DerbyDialect.class)
10941094
@SkipForDialect(dialectClass = SybaseDialect.class, matchSubTypes = true)
10951095
@SkipForDialect(dialectClass = AltibaseDialect.class, reason = "Altibase does not support offset of datetime")
1096+
@SkipForDialect(dialectClass = InformixDialect.class, reason = "Informix does not support offset datetime")
10961097
public void testCastToOffsetDatetime(SessionFactoryScope scope) {
10971098
scope.inTransaction( session -> {
10981099
session.createQuery("select cast(datetime 1911-10-09 12:13:14-02:00 as String)", String.class).getSingleResult();
@@ -1490,8 +1491,6 @@ public void testIntervalAddExpressions(SessionFactoryScope scope) {
14901491
.list();
14911492
session.createQuery("select e.theTime + 30 second from EntityOfBasics e", Date.class)
14921493
.list();
1493-
session.createQuery("select e.theTime + 300000000 nanosecond from EntityOfBasics e", Date.class)
1494-
.list();
14951494

14961495
session.createQuery("select e.theTimestamp + 1 year from EntityOfBasics e", Date.class)
14971496
.list();
@@ -1511,6 +1510,18 @@ public void testIntervalAddExpressions(SessionFactoryScope scope) {
15111510
);
15121511
}
15131512

1513+
@Test
1514+
@SkipForDialect(dialectClass = InformixDialect.class,
1515+
reason = "Adding nanoseconds to a time is weird anyway")
1516+
public void testAddNanosecondsToTime(SessionFactoryScope scope) {
1517+
scope.inTransaction(
1518+
session -> {
1519+
session.createQuery("select e.theTime + 300000000 nanosecond from EntityOfBasics e", Date.class)
1520+
.list();
1521+
}
1522+
);
1523+
}
1524+
15141525
@Test
15151526
public void testIntervalSubExpressions(SessionFactoryScope scope) {
15161527
scope.inTransaction(
@@ -2067,7 +2078,10 @@ public void testMoreIntervalDiffExpressions(SessionFactoryScope scope) {
20672078

20682079

20692080
@Test
2070-
@SkipForDialect(dialectClass = CockroachDialect.class, reason = "unsupported binary operator: <date> - <timestamp(6)>")
2081+
@SkipForDialect(dialectClass = CockroachDialect.class,
2082+
reason = "unsupported binary operator: <date> - <timestamp(6)>")
2083+
@SkipForDialect(dialectClass = InformixDialect.class,
2084+
reason = "Intervals or datetimes are incompatible for the operation")
20712085
public void testIntervalDiffExpressionsDifferentTypes(SessionFactoryScope scope) {
20722086
scope.inTransaction(
20732087
session -> {

hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/StandardFunctionTests.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import java.time.ZoneOffset;
1414
import java.time.ZonedDateTime;
1515

16+
import org.hibernate.community.dialect.InformixDialect;
1617
import org.hibernate.dialect.CockroachDialect;
1718

1819
import org.hamcrest.number.IsCloseTo;
@@ -566,7 +567,10 @@ public void testIntervalDiffExpressions(SessionFactoryScope scope) {
566567
}
567568

568569
@Test
569-
@SkipForDialect(dialectClass = CockroachDialect.class, reason = "unsupported binary operator: <date> - <timestamp(6)>")
570+
@SkipForDialect(dialectClass = CockroachDialect.class,
571+
reason = "unsupported binary operator: <date> - <timestamp(6)>")
572+
@SkipForDialect(dialectClass = InformixDialect.class,
573+
reason = "Intervals or datetimes are incompatible for the operation")
570574
public void testIntervalDiffExpressionsDifferentTypes(SessionFactoryScope scope) {
571575
scope.inTransaction(
572576
session -> {

0 commit comments

Comments
 (0)