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 uncaught/unhandled exception #664

Merged
merged 27 commits into from Apr 5, 2018
Merged

Conversation

rene-ye
Copy link
Member

@rene-ye rene-ye commented Mar 23, 2018

This PR addresses #659 where the SQL Server threw an exception but the driver did not handle it.

rene-ye and others added 16 commits February 2, 2018 15:46
To help debug an irreproducable/random mismatch error if it occurs in the future.
Merge dev into master for 6.5.0 preview
Added error handling logic for special cases.
Read the message length instead of reading until terminating character
Message length is an unsigned byte, converting before using.
convert the byte straight to an int and use existing constants instead of making new ones
fixed an issue where column names who had the hex token 'AA' would cause an error to be thrown.
@rene-ye rene-ye added this to the 6.5.1 milestone Mar 23, 2018
@rene-ye rene-ye self-assigned this Mar 23, 2018
@rene-ye rene-ye added this to Under Investigation in MSSQL JDBC via automation Mar 23, 2018
@rene-ye rene-ye requested review from ulvii and peterbae March 23, 2018 21:20
@rene-ye rene-ye moved this from Under Investigation to Under Peer Review in MSSQL JDBC Mar 23, 2018
@cheenamalhotra cheenamalhotra modified the milestone: 6.5.1 Mar 23, 2018
Changed IF EXISTS DROP commands to be compatible with sql server 2008
@codecov-io
Copy link

codecov-io commented Mar 26, 2018

Codecov Report

Merging #664 into dev will increase coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##                dev     #664      +/-   ##
============================================
+ Coverage     48.12%   48.18%   +0.05%     
- Complexity     2578     2581       +3     
============================================
  Files           113      113              
  Lines         26574    26584      +10     
  Branches       4429     4434       +5     
============================================
+ Hits          12790    12809      +19     
+ Misses        11660    11649      -11     
- Partials       2124     2126       +2
Flag Coverage Δ Complexity Δ
#JDBC42 48.03% <100%> (+0.09%) 2571 <0> (+1) ⬆️
#JDBC43 48.05% <100%> (ø) 2577 <0> (+1) ⬆️
Impacted Files Coverage Δ Complexity Δ
...m/microsoft/sqlserver/jdbc/SQLServerResultSet.java 33.74% <100%> (+0.25%) 249 <0> (+2) ⬆️
...om/microsoft/sqlserver/jdbc/ReaderInputStream.java 44.94% <0%> (-2.25%) 16% <0%> (-1%)
...ooglecode/concurrentlinkedhashmap/LinkedDeque.java 26.15% <0%> (-1.54%) 17% <0%> (-2%)
...rc/main/java/com/microsoft/sqlserver/jdbc/dtv.java 63.29% <0%> (-0.13%) 0% <0%> (ø)
...om/microsoft/sqlserver/jdbc/SQLServerBulkCopy.java 52.61% <0%> (-0.07%) 240% <0%> (ø)
...oft/sqlserver/jdbc/SQLServerResultSetMetaData.java 40.93% <0%> (-0.04%) 24% <0%> (+1%)
...in/java/com/microsoft/sqlserver/jdbc/Geometry.java 71.09% <0%> (ø) 33% <0%> (ø) ⬇️
...n/java/com/microsoft/sqlserver/jdbc/Geography.java 69.53% <0%> (ø) 33% <0%> (ø) ⬇️
...in/java/com/microsoft/sqlserver/jdbc/IOBuffer.java 54.16% <0%> (ø) 0% <0%> (ø) ⬇️
... 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 2039522...4f9c8c3. Read the comment docs.

rene-ye and others added 2 commits March 26, 2018 10:13
now only runs on compatible database or higher
cheenamalhotra
cheenamalhotra previously approved these changes Apr 2, 2018
Copy link
Contributor

@peterbae peterbae left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix spacing settings in eclipse if you can.

@rene-ye rene-ye merged commit 4ca55d9 into microsoft:dev Apr 5, 2018
MSSQL JDBC automation moved this from Under Peer Review to Closed/Merged PRs Apr 5, 2018
@rene-ye rene-ye deleted the issue659 branch April 5, 2018 00:22
@rene-ye rene-ye removed the request for review from ulvii April 5, 2018 15:14
rene-ye added a commit to rene-ye/mssql-jdbc that referenced this pull request Apr 6, 2018
* Added more information to error messages

To help debug an irreproducable/random mismatch error if it occurs in the future.

* Revert "Added information to error message"

This reverts commit 25301e6.

* Fix for microsoft#659

Added error handling logic for special cases.

* Read message length

Read the message length instead of reading until terminating character

* Unsigned byte update

Message length is an unsigned byte, converting before using.

* Removed clunky hex conversions

convert the byte straight to an int and use existing constants instead of making new ones

* Narrowed trigger conditions

fixed an issue where column names who had the hex token 'AA' would cause an error to be thrown.

* Spacing fixes

* Added test case

* spacing adjustment

* Edited test drop procedures

Changed IF EXISTS DROP commands to be compatible with sql server 2008

* github spacing misalignment fixes

* Changed test condition

now only runs on compatible database or higher

* Removed error check

Removed a previous implementation in favor of one that changes the TDS parser

* tdsreader change

* removing test for now

* enabled tests

* github spacing fix

* removed array import

* removed "arrays" instead of "array"

* spacing changes
rene-ye added a commit that referenced this pull request Apr 6, 2018
* Added more information to error messages

To help debug an irreproducable/random mismatch error if it occurs in the future.

* Fix for the issue when using setMaxRows() with SHOWPLAN ON (#666)

* Dont throw exception for colmetadata token

* Adding a comment

* Update comment

* Adding a warning message

* remove ignoreLengthPrefixedToken

* Fix for uncaught/unhandled exception (#664)

* Added more information to error messages

To help debug an irreproducable/random mismatch error if it occurs in the future.

* Revert "Added information to error message"

This reverts commit 25301e6.

* Fix for #659

Added error handling logic for special cases.

* Read message length

Read the message length instead of reading until terminating character

* Unsigned byte update

Message length is an unsigned byte, converting before using.

* Removed clunky hex conversions

convert the byte straight to an int and use existing constants instead of making new ones

* Narrowed trigger conditions

fixed an issue where column names who had the hex token 'AA' would cause an error to be thrown.

* Spacing fixes

* Added test case

* spacing adjustment

* Edited test drop procedures

Changed IF EXISTS DROP commands to be compatible with sql server 2008

* github spacing misalignment fixes

* Changed test condition

now only runs on compatible database or higher

* Removed error check

Removed a previous implementation in favor of one that changes the TDS parser

* tdsreader change

* removing test for now

* enabled tests

* github spacing fix

* removed array import

* removed "arrays" instead of "array"

* spacing changes

* Use Socket instead of SocketChannel when multiSubnetFailover=true (#662)

* Upped SQL Server requirement to 2017

* Removing Exception Test

Implement a more generic and compatible test in the future

* Removed imports

Used in removed test
cheenamalhotra pushed a commit that referenced this pull request Apr 6, 2018
* Added more information to error messages

To help debug an irreproducable/random mismatch error if it occurs in the future.

* Fix for the issue when using setMaxRows() with SHOWPLAN ON (#666)

* Dont throw exception for colmetadata token

* Adding a comment

* Update comment

* Adding a warning message

* remove ignoreLengthPrefixedToken

* Fix for uncaught/unhandled exception (#664)

* Added more information to error messages

To help debug an irreproducable/random mismatch error if it occurs in the future.

* Revert "Added information to error message"

This reverts commit 25301e6.

* Fix for #659

Added error handling logic for special cases.

* Read message length

Read the message length instead of reading until terminating character

* Unsigned byte update

Message length is an unsigned byte, converting before using.

* Removed clunky hex conversions

convert the byte straight to an int and use existing constants instead of making new ones

* Narrowed trigger conditions

fixed an issue where column names who had the hex token 'AA' would cause an error to be thrown.

* Spacing fixes

* Added test case

* spacing adjustment

* Edited test drop procedures

Changed IF EXISTS DROP commands to be compatible with sql server 2008

* github spacing misalignment fixes

* Changed test condition

now only runs on compatible database or higher

* Removed error check

Removed a previous implementation in favor of one that changes the TDS parser

* tdsreader change

* removing test for now

* enabled tests

* github spacing fix

* removed array import

* removed "arrays" instead of "array"

* spacing changes

* Use Socket instead of SocketChannel when multiSubnetFailover=true (#662)

* Upped SQL Server requirement to 2017

* Removing Exception Test

Implement a more generic and compatible test in the future

* Removed imports

Used in removed test

* Change in preperation for 6.5.1 preview release

* Removed SNAPSHOT from POM

* Added missing link

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
MSSQL JDBC
  
Closed/Merged PRs
Development

Successfully merging this pull request may close these issues.

None yet

4 participants