From 74d35b2d59c4fff09f40df6d393800c88dfdda7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yoann=20Rodi=C3=A8re?= Date: Mon, 26 Aug 2019 13:31:17 +0200 Subject: [PATCH] HHH-13580 Ignore LocalTimeTest and OffsetTimeTest's 'nativeWriteThenRead' test for MySQL The returned time is right (otherwise #writeThenRead would fail), it's just that a different day is returned, but it won't affect the LocalTime representation manipulated by the user. --- .../test/java/org/hibernate/test/type/LocalTimeTest.java | 7 +++++++ .../test/java/org/hibernate/test/type/OffsetTimeTest.java | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/hibernate-core/src/test/java/org/hibernate/test/type/LocalTimeTest.java b/hibernate-core/src/test/java/org/hibernate/test/type/LocalTimeTest.java index e4139ed48c..36bceb0235 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/type/LocalTimeTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/type/LocalTimeTest.java @@ -23,6 +23,7 @@ import org.hibernate.dialect.AbstractHANADialect; import org.hibernate.dialect.MariaDBDialect; +import org.hibernate.dialect.MySQL5Dialect; import org.hibernate.dialect.MySQLDialect; import org.hibernate.type.descriptor.sql.TimestampTypeDescriptor; @@ -186,6 +187,12 @@ protected Object getActualJdbcValue(ResultSet resultSet, int columnIndex) throws @Override @Test @SkipForDialect(value = AbstractHANADialect.class, comment = "HANA seems to return a java.sql.Timestamp instead of a java.sql.Time") + @SkipForDialect(value = MySQL5Dialect.class, + comment = "HHH-13580 MySQL seems to store the whole timestamp, not just the time," + + " which for some timezones results in a date other than 1970-01-01 being returned" + + " (typically 1969-12-31), even though the time is always right." + + " Since java.sql.Time holds the whole timestamp, not just the time," + + " its equals() method ends up returning false in this test.") public void writeThenNativeRead() { super.writeThenNativeRead(); } diff --git a/hibernate-core/src/test/java/org/hibernate/test/type/OffsetTimeTest.java b/hibernate-core/src/test/java/org/hibernate/test/type/OffsetTimeTest.java index 359742e57b..cb83f66941 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/type/OffsetTimeTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/type/OffsetTimeTest.java @@ -25,6 +25,7 @@ import org.hibernate.dialect.AbstractHANADialect; import org.hibernate.dialect.MariaDBDialect; +import org.hibernate.dialect.MySQL5Dialect; import org.hibernate.dialect.MySQLDialect; import org.hibernate.type.descriptor.sql.BigIntTypeDescriptor; import org.hibernate.type.descriptor.sql.TimestampTypeDescriptor; @@ -215,6 +216,12 @@ protected Object getActualJdbcValue(ResultSet resultSet, int columnIndex) throws @Override @Test @SkipForDialect(value = AbstractHANADialect.class, comment = "HANA seems to return a java.sql.Timestamp instead of a java.sql.Time") + @SkipForDialect(value = MySQL5Dialect.class, + comment = "HHH-13580 MySQL seems to store the whole timestamp, not just the time," + + " which for some timezones results in a date other than 1970-01-01 being returned" + + " (typically 1969-12-31), even though the time is always right." + + " Since java.sql.Time holds the whole timestamp, not just the time," + + " its equals() method ends up returning false in this test.") public void writeThenNativeRead() { super.writeThenNativeRead(); }