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

FieldCount throws InvalidOperationException in 0.60.1 #728

Closed
bgrainger opened this issue Oct 21, 2019 · 3 comments
Closed

FieldCount throws InvalidOperationException in 0.60.1 #728

bgrainger opened this issue Oct 21, 2019 · 3 comments

Comments

@bgrainger
Copy link
Member

Fixed in 0.60.1.

There are cases when we check the data reader FieldCount property, in order to know if we should read the data reader. With the latest update, all these checks on the data reader are throwing exceptions, when the reader is empty and only output parameters are returned.

This breaks some of our property checks on the data reader, where until now no exception was expected.

Also, executing a query that, by its nature, does not return rows (such as a DELETE query), should set FieldCount to 0. What about the HasRows property?

Originally posted by @kostebudinoski in #722 (comment)

@bgrainger
Copy link
Member Author

This was an unintentional regression in 0.60.1.

(There are tests for FieldCount and HasRows for a "regular" empty MySqlDataReader, but not for the pseudo-empty one that represents a stored procedure with only output parameters.)

@kostebudinoski
Copy link

Great! Thanks!

@bgrainger
Copy link
Member Author

Fixed in 0.60.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants