writeThenRead, nativeWriteThenRead and writeThenNativeRead tests are all failing with errors similar to:
java.lang.AssertionError: Values written by Hibernate ORM should match the original value (same day, hour, ...) expected:<2018-03-25> but was:<2018-03-24>
Neither am I.
There might be one explanation... The test suite changes the default JVM time zone multiple times during its execution, to simulate different real-world scenarios. However, the MySQL JDBC driver caches the JVM time zone in a static variable, which might introduce side-effects between tests.
Could you please try setting the cacheDefaultTimezone JDBC driver property to false, to rule out the problem mentioned above?
The setting is provided through the JDBC URL. For example, instead of this:
Another potential explanation: the legacy date-time code in MySQL ConnectorJ 5.x is notoriously buggy when it comes to handling timezones. Setting useLegacyDatetimeCode=false could solve a lot of problems.
So instead of this:
Digging up, you're using MySQL ConnectorJ 8.x, whereas our tests use 5.x. These version have vastly different date/time handling. I'll upgrade our tests.
This is caused by https://bugs.mysql.com/bug.php?id=91112.
In essence, MySQL ConnectorJ 8.x applies timezone conversion to dates before writing them (which might change the exact date), then truncates the time part when storing it in the database. So when it retrieves the date later, there is no way it can convert it back to the original date.
Apparently they consider it's not a bug, because the JDBC spec does not state explicitly what they are supposed to do. Never mind that all other JDBC drivers do it differently...
Anyway, if they consider that's how things are supposed to work, there's not much we can do to work around the problem. I'll disable the tests.
Fixed in master and 5.3 branches.