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

MySqlConnection.GetSchema(string collectionName) should be case insensitive #852

Closed
yyjdelete opened this issue Jul 20, 2020 · 3 comments
Closed
Assignees

Comments

@yyjdelete
Copy link
Contributor

yyjdelete commented Jul 20, 2020

Should collectionName in DbConnection.GetSchema(string collectionName) be case insensitive?

I didn't find any document of ado.net of that, but seems some other provider like SqlClient, Npgsql, Mysql.Data treat it as case insensitive.

SqlClient: Check with ADP.CompareInsensitiveInvariant(the same as string.Equals(a, b, StringComparison.InvariantCultureIgnoreCase)), match case-sensitive first(?looks like something wrong in the logic) and fallback to case-insensitive version if not found;

https://github.com/dotnet/SqlClient/blob/master/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Microsoft/Data/ProviderBase/DbMetaDataFactory.cs#L268

Npsql/Mysql.Data: Use string.ToUpperInvariant() directly;
https://github.com/npgsql/npgsql/blob/a9cab33e4d3a384cbcc05c1bd78c2bf6b80bd314/src/Npgsql/NpgsqlSchema.cs#L25
https://github.com/mysql/mysql-connector-net/blob/68c54371821c87ff40a773acc127ce357b46a5ae/Source/MySql.Data/SchemaProvider.cs#L57

MySqlConnector: v1.0.0

@bgrainger bgrainger changed the title [Question]Should collectionName in DbConnection.GetSchema(string collectionName) be case insensitive? MySqlConnection.GetSchema(string collectionName) should be case insensitive Jul 20, 2020
@bgrainger
Copy link
Member

bgrainger commented Jul 20, 2020

Thanks for the detailed research! This does look like it should be case-insensitive (for compatibility).

@bgrainger bgrainger self-assigned this Jul 20, 2020
@bgrainger
Copy link
Member

bgrainger commented Jul 20, 2020

Fixed in 0.69.8.

Fix for 1.x is in GitHub Package Registry, 1.0.1-beta.0.11 or later: https://github.com/mysql-net/MySqlConnector/packages/39735

@bgrainger
Copy link
Member

bgrainger commented Aug 13, 2020

Fixed in 1.0.1.

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