Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: investigate Hibernate's testTemporalType #26804

Closed
BramGruneir opened this issue Jun 18, 2018 · 8 comments
Closed

sql: investigate Hibernate's testTemporalType #26804

BramGruneir opened this issue Jun 18, 2018 · 8 comments
Labels
A-tools-hibernate Issues that pertain to Hibernate integration. C-investigation Further steps needed to qualify. C-label will change.

Comments

@BramGruneir
Copy link
Member

BramGruneir commented Jun 18, 2018

from org.hibernate.test.annotations.EntityTest testTemporalType

Somehow, a timestamp changes values. I'm not sure if this is happening during the write or the read. More investigation is requried.

create table Flight (                                                                                                                            
  id int8 not null,                                                                                                                                                          
  alternativeDepartureDate timestamp,                                                                                                                                       
  primary key (id)                                                                                                                                                      
);
insert into Flight (id, alternativeDepartureDate) values (1, '1970-01-02 04:59:27.443');
select * from Flight;

In the hibernate test output, the value changes:

org.junit.ComparisonFailure: expected:<January 2, 1970 at [4]:59:27 AM EST> but was:<January 2, 1970 at [9]:59:27 AM EST>
	at org.junit.Assert.assertEquals(Assert.java:115)
	at org.junit.Assert.assertEquals(Assert.java:144)
	at org.hibernate.test.annotations.EntityTest.lambda$testTemporalType$1(EntityTest.java:403)
...
@BramGruneir BramGruneir added C-investigation Further steps needed to qualify. C-label will change. A-tools-hibernate Issues that pertain to Hibernate integration. labels Jun 18, 2018
@BramGruneir
Copy link
Member Author

6 more failures:

  • org.hibernate.test.cid.CompositeIdWithGeneratorTest
    • testCompositeIdSimple
    • testDetachedId
    • testDetachedProperty
    • testEvict
    • testLoad
    • testMerge

@knz
Copy link
Contributor

knz commented Jun 19, 2018

This is a time zone problem. Check what is the default time zone expected.

@knz
Copy link
Contributor

knz commented Jun 22, 2018

What is the full syntax of the CREATE TABLE statement? It's truncated above. We need this to fully investigate.

@BramGruneir
Copy link
Member Author

That seems like the most plausible explanation.

@knz
Copy link
Contributor

knz commented Jun 30, 2018

@BramGruneir This issue is improperly qualified. It does neither state what is the deviation (difference between expected behavior and actual behavior) nor what action items should be carried out.

Unless you provide either (preferably both), we can't do anything with this.

@knz knz added the X-unactionable This was closed because it was unactionable. label Jun 30, 2018
@BramGruneir
Copy link
Member Author

The expected behaviour and actual are spelled out in the issue.

org.junit.ComparisonFailure: expected:<January 2, 1970 at [4]:59:27 AM EST> but was:<January 2, 1970 at [9]:59:27 AM EST>

And the create table statement was there in full. Just poorly formatted. It has been fixed.

And I still agree, this is most likely a time zone issue.

@BramGruneir BramGruneir removed the X-unactionable This was closed because it was unactionable. label Jul 2, 2018
@knz knz changed the title sql: Hibernate timestamp reading weirdness sql: investigate Hibernate's testTemporalType Jul 2, 2018
@knz
Copy link
Contributor

knz commented Jul 2, 2018

The problem might be in Hibernate's testTemporalType instead of CockroachDB. We simply don't know. Renamed the issue to reflect the investigation to be done, instead of the working theory.

@jordanlewis
Copy link
Member

All of the tests in this issue pass now, as of 2.1! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tools-hibernate Issues that pertain to Hibernate integration. C-investigation Further steps needed to qualify. C-label will change.
Projects
None yet
Development

No branches or pull requests

3 participants