[hibernate-dev] Tests fail on MySQL due to timestamp precision issues

Vlad Mihalcea mihalcea.vlad at gmail.com
Thu Mar 17 04:05:44 EDT 2016


Hi,

While running the test suite on MySQL, I noticed that some of those fail
because of DATETIME/TIMESTAMP precision.
Prior to MySQL 5.6.4, these types didn't have microsecond precision at all.
Using a newer MySQL version, these tests will work like on other DBs but it
will require changing the column definitions to DATETIME(6), TIMESTAMP(6).

To avoid breaking backward compatibility, what do you think of adding a new
Configuration Property: "hibernate.mysql.fractional.seconds" (or a
MySQLDialect method)
which gives the default fractional second precision used when creating
these column types.

This way we can have all these tests work with just a single Hibernate
configuration property.

Vlad


More information about the hibernate-dev mailing list