Skip to content

Fix parameter meta data with whitespace characters#351

Closed
xiangyushawn wants to merge 6 commits intomicrosoft:devfrom
xiangyushawn:fix-ParameterMetaData-with-whitespace-characters
Closed

Fix parameter meta data with whitespace characters#351
xiangyushawn wants to merge 6 commits intomicrosoft:devfrom
xiangyushawn:fix-ParameterMetaData-with-whitespace-characters

Conversation

@xiangyushawn
Copy link
Copy Markdown
Contributor

@xiangyushawn xiangyushawn commented Jun 21, 2017

Fixes #344

@codecov-io
Copy link
Copy Markdown

Codecov Report

Merging #351 into dev will increase coverage by 0.09%.
The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff              @@
##                dev     #351      +/-   ##
============================================
+ Coverage     37.23%   37.33%   +0.09%     
- Complexity     1666     1701      +35     
============================================
  Files           103      103              
  Lines         23667    23669       +2     
  Branches       3880     3881       +1     
============================================
+ Hits           8813     8837      +24     
- Misses        13261    13277      +16     
+ Partials       1593     1555      -38
Flag Coverage Δ Complexity Δ
#JDBC41 37.24% <0%> (+0.2%) 1697 <0> (+41) ⬆️
#JDBC42 37.23% <0%> (+0.06%) 1694 <0> (+31) ⬆️
Impacted Files Coverage Δ Complexity Δ
...oft/sqlserver/jdbc/SQLServerParameterMetaData.java 25.52% <0%> (-0.13%) 30 <0> (ø)
...rc/main/java/com/microsoft/sqlserver/jdbc/DDC.java 29.46% <0%> (-0.23%) 55% <0%> (-1%)
...rc/main/java/com/microsoft/sqlserver/jdbc/dtv.java 36.75% <0%> (-0.21%) 0% <0%> (ø)
...soft/sqlserver/jdbc/SQLServerDatabaseMetaData.java 29.01% <0%> (-0.12%) 47% <0%> (+1%)
...om/microsoft/sqlserver/jdbc/SQLServerBulkCopy.java 49.04% <0%> (-0.08%) 212% <0%> (+1%)
...m/microsoft/sqlserver/jdbc/SQLServerException.java 77.23% <0%> (ø) 30% <0%> (+1%) ⬆️
.../microsoft/sqlserver/jdbc/SQLServerConnection.java 44% <0%> (+0.08%) 254% <0%> (+2%) ⬆️
...m/microsoft/sqlserver/jdbc/SQLServerResultSet.java 27.36% <0%> (+0.12%) 195% <0%> (+8%) ⬆️
...oft/sqlserver/jdbc/SQLServerPreparedStatement.java 33.8% <0%> (+0.17%) 94% <0%> (+4%) ⬆️
...in/java/com/microsoft/sqlserver/jdbc/IOBuffer.java 46.25% <0%> (+0.2%) 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 244c59d...0db793f. Read the comment docs.

@codecov-io
Copy link
Copy Markdown

codecov-io commented Jun 21, 2017

Codecov Report

Merging #351 into dev will increase coverage by 0.16%.
The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff             @@
##                dev    #351      +/-   ##
===========================================
+ Coverage     37.23%   37.4%   +0.16%     
- Complexity     1666    1704      +38     
===========================================
  Files           103     103              
  Lines         23667   23671       +4     
  Branches       3880    3882       +2     
===========================================
+ Hits           8813    8854      +41     
- Misses        13261   13263       +2     
+ Partials       1593    1554      -39
Flag Coverage Δ Complexity Δ
#JDBC41 37.29% <0%> (+0.25%) 1701 <0> (+45) ⬆️
#JDBC42 37.26% <0%> (+0.09%) 1695 <0> (+32) ⬆️
Impacted Files Coverage Δ Complexity Δ
...oft/sqlserver/jdbc/SQLServerParameterMetaData.java 25.52% <0%> (-0.13%) 30 <0> (ø)
...om/microsoft/sqlserver/jdbc/ReaderInputStream.java 41.57% <0%> (-3.38%) 14% <0%> (-2%)
...soft/sqlserver/jdbc/SQLServerDatabaseMetaData.java 29.01% <0%> (-0.12%) 46% <0%> (ø)
.../microsoft/sqlserver/jdbc/SQLServerConnection.java 43.84% <0%> (-0.08%) 254% <0%> (+2%)
...rc/main/java/com/microsoft/sqlserver/jdbc/dtv.java 37.03% <0%> (+0.06%) 0% <0%> (ø) ⬇️
...in/java/com/microsoft/sqlserver/jdbc/IOBuffer.java 46.28% <0%> (+0.23%) 0% <0%> (ø) ⬇️
...m/microsoft/sqlserver/jdbc/SQLServerResultSet.java 27.61% <0%> (+0.37%) 196% <0%> (+9%) ⬆️
...oft/sqlserver/jdbc/SQLServerPreparedStatement.java 34.07% <0%> (+0.44%) 97% <0%> (+7%) ⬆️
...m/microsoft/sqlserver/jdbc/SQLServerStatement.java 59.59% <0%> (+0.51%) 138% <0%> (+9%) ⬆️
...om/microsoft/sqlserver/jdbc/SQLServerBulkCopy.java 49.75% <0%> (+0.63%) 215% <0%> (+4%) ⬆️
... and 4 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 244c59d...a275e6e. Read the comment docs.

@vobarian
Copy link
Copy Markdown

vobarian commented Jun 22, 2017

I was just looking at the PR and it occurred to me that it might still not handle tabs correctly since I did not see those in the delimiter sets that were modified. I didn't provide separate test cases for those but I mentioned it in the comments. The tests would just be the same as the ones I showed but with tab characters of course. I'm not sure what characters the server accepts as delimiters, but it might be worth seeing if there are any other characters that might be missing.
[Edit: Realized that is not a regex.]

@xiangyushawn
Copy link
Copy Markdown
Contributor Author

@chadberchek thank you very much for the excellent finding. As you suggested, I added support for tab and form feed. I think that should be all the whitespaces we need to support.

I am going to add your test code into our test suite. Thank you.

@xiangyushawn
Copy link
Copy Markdown
Contributor Author

Test is added now. @chadberchek again, I very appreciate the test you provided.


@AfterAll
public static void dropTables() throws SQLException {
stmt.execute("if object_id('" + tableName + "','U') is not null" + " drop table " + tableName);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please use Utils.dropObjectIfExists(tableName,"IsTable",stmt) function to drop table.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

@xiangyushawn
Copy link
Copy Markdown
Contributor Author

new PR #371 is created to get rid of Revert-MetadataCaching

@xiangyushawn xiangyushawn deleted the fix-ParameterMetaData-with-whitespace-characters branch July 6, 2017 20: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.

7 participants