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

Fix for updating datetime value #962

Merged
merged 15 commits into from
Mar 13, 2019
Merged

Conversation

peterbae
Copy link
Contributor

Starting from SQL Server 2016, the rounding logic for inserting datetime value has been changed. Instead of uniformly rounding up values normally (<=4 rounds down, >=5 rounds up), the logic present in the getRoundedMilliseconds method shows how the numbers are actually rounded.

The writeRPCDateTime method that gets used during updating a datetimecolumn wasn't correctly reflecting this, and this PR addresses that issue.

@codecov-io
Copy link

codecov-io commented Feb 13, 2019

Codecov Report

Merging #962 into dev will decrease coverage by 0.75%.
The diff coverage is 45.83%.

Impacted file tree graph

@@             Coverage Diff              @@
##                dev     #962      +/-   ##
============================================
- Coverage     50.58%   49.83%   -0.76%     
+ Complexity     2918     2847      -71     
============================================
  Files           120      120              
  Lines         27987    28004      +17     
  Branches       4678     4682       +4     
============================================
- Hits          14158    13956     -202     
- Misses        11532    11789     +257     
+ Partials       2297     2259      -38
Flag Coverage Δ Complexity Δ
#JDBC42 49.45% <45.83%> (-0.7%) 2811 <2> (-68)
#JDBC43 49.7% <45.83%> (-0.75%) 2843 <2> (-70)
Impacted Files Coverage Δ Complexity Δ
...rc/main/java/com/microsoft/sqlserver/jdbc/dtv.java 68.24% <100%> (-0.36%) 0 <0> (ø)
.../microsoft/sqlserver/jdbc/SQLServerConnection.java 46.6% <43.47%> (+0.1%) 343 <2> (+1) ⬆️
...sqlserver/jdbc/SQLServerBulkBatchInsertRecord.java 0% <0%> (-30.72%) 0% <0%> (-18%)
...om/microsoft/sqlserver/jdbc/ReaderInputStream.java 40.65% <0%> (-6.6%) 13% <0%> (-2%)
...oft/sqlserver/jdbc/SQLServerPreparedStatement.java 47.16% <0%> (-6.25%) 189% <0%> (-27%)
.../microsoft/sqlserver/jdbc/SQLServerBulkCommon.java 41.66% <0%> (-5.56%) 3% <0%> (-2%)
...om/microsoft/sqlserver/jdbc/SQLServerBulkCopy.java 49.96% <0%> (-1.67%) 239% <0%> (-15%)
...m/microsoft/sqlserver/jdbc/SQLServerException.java 75.93% <0%> (-1.51%) 31% <0%> (-1%)
...rc/main/java/com/microsoft/sqlserver/jdbc/DDC.java 46.22% <0%> (-1.08%) 110% <0%> (-2%)
...m/microsoft/sqlserver/jdbc/SQLServerResultSet.java 43.21% <0%> (-0.46%) 313% <0%> (-3%)
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2eebc8a...2dd5560. Read the comment docs.

@peterbae peterbae changed the base branch from master to dev February 15, 2019 21:10
@peterbae
Copy link
Contributor Author

I re-ran the CI build and it passed: https://dev.azure.com/sqlclientdrivers-ci/mssql-jdbc/_build/results?buildId=278

@cheenamalhotra cheenamalhotra added this to the 7.3.0 milestone Mar 5, 2019
@peterbae peterbae merged commit 96f31c7 into microsoft:dev Mar 13, 2019
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.

6 participants