Skip to content

Conversation

@tsegismont
Copy link
Contributor

Fixes #1014

Starting from Java 11, LocalDateTime.now() can have microseconds precision.
But the test database defines the test_datetimeoffset column with scale of 5.

Therefore, in order to get consistent behavior between Java 8 and Java 11,
we erase the nanoOfSecond value obtained from the clock with a random number
which has at most tens of microseconds precision.

Fixes eclipse-vertx#1014

    Starting from Java 11, LocalDateTime.now() can have microseconds precision.
    But the test database defines the test_datetimeoffset column with scale of 5.

    Therefore, in order to get consistent behavior between Java 8 and Java 11,
    we erase the nanoOfSecond value obtained from the clock with a random number
    which has at most tens of microseconds precision.

Signed-off-by: Thomas Segismont <[email protected]>
@tsegismont tsegismont requested a review from vietj July 28, 2021 16:57
@tsegismont
Copy link
Contributor Author

@vietj this will fix build issues in #1011

Once it is merged, I will backport the fix to 4.1 branch.

@vietj
Copy link
Member

vietj commented Aug 2, 2021

I'll merge and cherry pick

@vietj vietj merged commit 1cd70f2 into eclipse-vertx:master Aug 2, 2021
@vietj vietj added this to the 4.2.0 milestone Aug 2, 2021
@tsegismont
Copy link
Contributor Author

Thank you @vietj

@tsegismont tsegismont deleted the offsetdatetime_encode_test branch August 11, 2021 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MSSSQL testEncodeOffsetDateTime fails with JDK11

2 participants