-
Notifications
You must be signed in to change notification settings - Fork 435
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
getMoreResults Skips resultsets[BUG] #969
Comments
the following test function skips every secound Result set with gradle:testCompile group: 'com.microsoft.sqlserver', name: 'mssql-jdbc', version: '7.2.1.jre8' ` public static void testMoreResults(Connection con) {
` expected result: result #2: firstColumnName:Column_name result #3: firstColumnName:Identity result #4: firstColumnName:RowGuidCol result #5: firstColumnName:Data_located_on_filegroup result #6: firstColumnName:index_name result #7: firstColumnName:constraint_type FOREIGN KEY FOREIGN KEY FOREIGN KEY FOREIGN KEY FOREIGN KEY PRIMARY KEY (clustered) result #8: firstColumnName:Table is referenced by foreign key result with 7.2.1.jre8: `result: resulest #1: firstColumnName:Name resulest #2: firstColumnName:Identity resulest #3: firstColumnName:Data_located_on_filegroup resulest #4: firstColumnName:constraint_type FOREIGN KEY FOREIGN KEY FOREIGN KEY FOREIGN KEY FOREIGN KEY PRIMARY KEY (clustered) |
Hi @michaeldenkmal, thanks for reporting this issue. We've confirmed the behavior has started from 7.1.0 release, and we're looking into it. |
Thank you ;) |
Can confirm this bug as well, unit tests started failing with "invalid column" for a routine that collects metadata from sp_help after updating to 7.2.1.jre8 from 7.0.0.jre8. It seems the ResultSet pointer is advanced automatically when (all?) rows are read. If no rows where read (i.e rs.next() not called) then getMoreResults() worked as expected (rs.getMetaData().getColumn(1) returned correct first column name). |
This one sound scary, as I use multiple rs returned from some stored procedures, but I haven't seen this problem (I think). Is this a general problem or something that can happen with calls of MetaData() ? |
With the latest driver this always happens (for me) even if getMetaData() is not used. I had code that used sp_help and iterated through all result sets from it that started failing after updating to the latest driver. |
@biasb So is it specific (more or less) to sp_help ? select * from tableA;
select * from tableB;
select * from tableC; where B would be skipped ? |
This issue occurs only in cases where SQL Warnings are recieved with ResultSets. If no SQL Warnings are recieved, the driver does not attempt parsing them and the resultsets are available as expected. We have found out the warning parsing is parsing additional information which is leading in missing next ResultSet from stream. Work is in progress to fix this behavior, will let you know soon. |
Hi @michaeldenkmal @martinm1000 @biasb I just created PR #991 to fix the reported issue. Request you to test and confirm if everything works as desired. |
I found the same issue while converting our project over to using mssql-jdbc. I was about to open an issue...but found that it was already created. I did a quick test with the code changes and it seems to have fixed the issue. Any estimate as to when PR 991 will come out with the next release? |
Thanks for confirming. The team will be reviewing the PR soon sometime, so far it hasn't been milestoned for a specific release. Stay tuned for further updates! |
I also encountered this problem |
Hi @michaeldenkmal @free2bcreative @softboy99 PR #991 was merged today, hence closing the issue. The fix will be available in next preview release. Thank you! |
Same issue with Sybase. Using the jconnect-7.0.7.jar. Will appreciate a solution. |
Hi @upadas, If you are still having issues with our driver, please create a new issue and we can help you from there. |
Driver version
SQL Server version
Client Operating System
JAVA/JVM version
Table schema
Problem description
JDBC trace logs
Reproduction code
The text was updated successfully, but these errors were encountered: