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

GetSchemaTable returns information about first result set #581

Closed
bgrainger opened this issue Nov 4, 2018 · 1 comment
Closed

GetSchemaTable returns information about first result set #581

bgrainger opened this issue Nov 4, 2018 · 1 comment
Assignees
Labels

Comments

@bgrainger
Copy link
Member

@bgrainger bgrainger commented Nov 4, 2018

When executing a command that returns multiple result sets, calling GetSchemaTable on the first result set caches the schema for the lifetime of the MySqlDataReader.

using (var cmd = new MySqlCommand("select * from table1; select * from table2;", connection))
using (var reader = cmd.ExecuteReader())
{
	do
	{
		// always returns the schema for 'table1'
		var table = reader.GetSchemaTable();
		while (reader.Read())
		{
		}
	} while (reader.NextResult());
}
@bgrainger bgrainger added the bug label Nov 4, 2018
@bgrainger bgrainger self-assigned this Nov 4, 2018
@bgrainger
Copy link
Member Author

@bgrainger bgrainger commented Nov 4, 2018

Fixed in 0.47.1.

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

No branches or pull requests

1 participant