Bug 1153069

Summary: (6.4.0) [HHH-9444] rounding of fractional seconds in MySQL 5.6.4+ can lead to unexpected results
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Martin Simka <msimka>
Component: HibernateAssignee: Gail Badner <gbadner>
Status: CLOSED CURRENTRELEASE QA Contact: Martin Simka <msimka>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 6.4.0CC: bbaranow, cdewolf, dandread, jdoyle, kkhan, msimka, myarboro, ochaloup, smarlow
Target Milestone: ER1   
Target Release: EAP 6.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: dev_no_blocker
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1173461 (view as bug list) Environment:
Last Closed: 2019-08-19 12:43:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1173454, 1173461    

Description Martin Simka 2014-10-15 14:54:04 UTC
*Description of problem:
https://hibernate.atlassian.net/browse/HHH-9444

The temporal datatypes 'TIME/DATETIME/TIMESTAMP' supports fractional values starting from MySQL 5.6.4 version.

See: http://dev.mysql.com/doc/refman/5.6/en/fractional-seconds.html

Without defining the number of fractional decimals it defaults to 0. In this case '2013-04-01 23:59:59.500' rounds to '2013-04-02 00:00:00'.

This affects tests in test suite:
example from:
org.hibernate.test.cid.CompositeIdWithGeneratorTest.testDetachedProperty

// change a non-id property, but do not persist
Date persistedTimestamp = record.getTimestamp();
Date newTimestamp = new Date(persistedTimestamp.getTime() + 1);
record.setTimestamp(newTimestamp);

assertEquals( df.format(persistedTimestamp), df.format(found) );


*Version-Release number of selected component (if applicable):
Hibernate-orm 4.2.14.SP1

Comment 4 JBoss JIRA Server 2014-11-24 12:13:51 UTC
Pavel Janousek <pjanouse> updated the status of jira EAP6-209 to Reopened

Comment 13 Gail Badner 2014-12-18 21:29:04 UTC
This BZ references HHH-9444, which has to do with test failures. The tests failures are fixed by the new dialect added for HHH-8401.

Should this BZ reference HHH-8401 instead?

Comment 14 Carlo de Wolf 2015-01-05 10:15:33 UTC
HHH-9444 references back to HHH-8401, so I consider the breadcrumb trail complete.

Comment 15 Kabir Khan 2015-01-06 13:32:56 UTC
Hibernate upgrade 4.2.17.Final-redhat-1/https://bugzilla.redhat.com/show_bug.cgi?id=1173454 should have fixed this

Comment 16 JBoss JIRA Server 2015-01-13 20:53:13 UTC
Kabir Khan <kabir.khan> updated the status of jira EAP6-209 to Resolved

Comment 17 Martin Simka 2015-01-20 14:01:18 UTC
verified on EAP 6.4.0.ER1

Comment 18 JBoss JIRA Server 2015-04-28 15:04:10 UTC
John Doyle <jdoyle> updated the status of jira EAP6-340 to Closed

Comment 19 JBoss JIRA Server 2015-04-28 15:05:15 UTC
John Doyle <jdoyle> updated the status of jira EAP6-209 to Closed