java.time.OffsetDateTime value sent to the server should not be affected by the default time zone.#831
Merged
cheenamalhotra merged 6 commits intomicrosoft:devfrom Dec 28, 2018
Conversation
…as a different time zone than the default time zone is passed to `PreparedStatement#setObject()`, the driver sends an incorrect value.
…Time(). `java.sql.Timestamp#getTime()` subsequently invokes `java.util.Date#normalize()` which takes the default TimeZone into account.
Codecov Report
@@ Coverage Diff @@
## dev #831 +/- ##
============================================
+ Coverage 49.69% 49.93% +0.23%
- Complexity 2880 2884 +4
============================================
Files 117 118 +1
Lines 27998 28006 +8
Branches 4666 4673 +7
============================================
+ Hits 13915 13984 +69
+ Misses 11839 11772 -67
- Partials 2244 2250 +6
Continue to review full report at Codecov.
|
This was referenced Oct 14, 2018
|
Any news on this PR? This is really a problem on my side as well. |
Contributor
|
hi @petarov, Sorry it had taken us a while to get to this. We are now in the process of reviewing this PR and I am tasked to run this through our test lab. Once this is completed we will be looking at merging this for the upcoming release. Thanks for your patience! |
cheenamalhotra
previously approved these changes
Dec 10, 2018
ulvii
reviewed
Dec 11, 2018
cheenamalhotra
approved these changes
Dec 27, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Although
SQLServerPreparedStatement#setObject(int, Object)supportsjava.time.OffsetDateTime, the driver sends an incorrect temporal data when the parameter has a different time zone than the default time zone.Please see the attached test case.
java.sql.Timestamp#getTime()used inDTV#sendTemporal()subsequently invokesjava.util.Date#normalize()which takes the default TimeZone into account.