LocalDateCustomSessionLevelTimeZoneTest fails with mysql 5.5 and 5.7

Description

org.hibernate.test.timestamp.LocalDateCustomSessionLevelTimeZoneTest.classMethod

There are likely two issues:

  1. in test, CONVERT_TO_NULL is added only for MySQL8Dialect +, older dialects uses convertToNull

  2. NPE in org.hibernate.engine.jdbc.connections.internal.BasicConnectionCreator

real error is

Environment

MySQL 5.5 - org.hibernate.dialect.MySQL5InnoDBDialect (I know I should have used MySQL55Dialect)
MySQL 5.7 - org.hibernate.dialect.MySQL57Dialect

mysql-connector-java-8.0.11.jar

Activity

Show:
Guillaume Smet
July 17, 2018, 2:59 PM
Edited

I'm wondering if the issue is not that you use a very recent driver.

I wouldn't expect these old dialects to be compatible with this version of the driver. And I'm not sure we can be compatible with both versions of the driver (people using MySQL 5.7 probably also use an old driver).

Martin Simka
July 18, 2018, 7:40 AM

yeah, that would be the case, it passes with mysql-connector-java-5.1.42-bin.jar

Guillaume Smet
July 19, 2018, 9:39 AM

could you simply try to remove the zeroDateTimeBehavior option altogether?

I don't think it's useful at all in this test case, considering we don't set zero dates. The purpose of this test is to test custom time zone configuration and we don't need that option to do that.

Martin Simka
July 19, 2018, 10:35 AM

It passes when zeroDateTimeBehavior is removed, but I see it was added in 5cfb0a508cf7 as part of support of some MySQL 8 feature. I don't have MySQL 8 here to test with.

Guillaume Smet
July 19, 2018, 11:03 AM

> but I see it was added in 5cfb0a508cf7 as part of support of some MySQL 8 feature

Not really, it was just adapted to also make it work with MySQL 8. The zeroDateTimeBehavior=convertToNull was present before.

The option was present in the original JDBC URL of the person complaining in https://hibernate.atlassian.net/browse/HHH-11396 but it has no value for this test.

I'm going to remove it.

Assignee

Guillaume Smet

Reporter

Martin Simka

Fix versions

Labels

backPortable

Backport?

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

backportReEvaluate

Components

Affects versions

Priority

Major
Configure