-
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
Exception using setMaxRows() followed by query execution when showplan_text is on #661
Comments
+1 |
4 similar comments
+1 |
+1 |
+1 |
+1 |
Hi @tseylerd , I can confirm that this is a bug in the driver and we will address the issue in one of the upcoming preview releases. |
@ulvii Hi! Thanks a lot, guys. |
@ulvii First of all, thank you for a fix. We'll test it today. I know that I'm not a reviewer, but in my opinion it would be better to put warning in statement object in this case. This way makes possible to notify a client that something unexpected happens without any exception. Please, just ignore it if you don't think so. |
@ulvii I've tested and it doesn't work. Now it fails with "[08S01] The TDS protocol stream is not valid. Unexpected token unknown token (0x0)" |
Hi @tseylerd , Looks like I accidentally uploaded the wrong jars. Please try the updated zip file again, I apologize for inconvenience. I added a few more lines that generate additional log for this case. I agree that removing the exception might not seem like the best approach, but other solutions I looked into either result in performance degradation or do not completely solve the issue. Please also feel free to create and review pull requests, we appreciate contributions from the community. |
@ulvii Thanks, it works! |
Closing the issue since PR merged and fix released with 6.5.1 preview release. |
Driver version or jar name
6.0.8112.100
SQL Server version
14.0 (Linux)
Client operating system
macOS
Java/JVM version
1.8 OpenJDK
Problem description
When the SHOWPLAN_TEXT is on, driver may fail on statement execution. Especially, using setMaxRows() on statement before execution. The problem is that before querying driver sends SET ROWCOUNT to the database and expects nothing as a results. But showplan_text is on and database will return result set causing driver failure with:
Expected behavior and actual behavior
I think the code should be executed without errors.
Actually there is an exception.
Repro code
The text was updated successfully, but these errors were encountered: