-
Notifications
You must be signed in to change notification settings - Fork 335
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
collation connection set to utf8mb4_bin #585
Comments
The default is Are you comparing two literal strings in your SQL? I'm trying to understand the exact use case here. A workaround is to specify the collation you want to use in your SQL: select 'All'='all' collate utf8mb4_general_ci; -- returns 1 with any connector |
I have some more complex queries that use parameters and in some cases the query does end up comparing the passed in parameter to a literal string. Here's an example of using what I'm working on. Hopefully it will be clear why I'd prefer a different default. |
This seems reasonable change to make for compatibility; most SQL users are probably used to case-insensitive comparison as the default Unfortunately, when connecting we have to specify a precise collation, not just use the server's default for If this is a significant problem, a |
Thank you for the quick action. I'm very impressed by this project and how quickly issues are being addressed. |
@caleblloyd Will this cause any problems for Pomelo.EntityFrameworkCore.MySql? Are there integration tests that could be run with MySqlConnector 0.48.0-beta2 just to ensure it doesn't introduce any issues? |
Fixed in 0.48.0. |
Is there a reason that the default connection collation is utf8mb4_bin? I've been using the Oracle .MySql Connector/NET and it seems to default to utf8mb4_general_ci. I'm trying to switch over to MySqlConnector, but this makes it more difficult. This is causing issues where I have items that compare data I pass in to a string. This is run against MySQL 5.6.
An easy way to see this to do a simple query like:
select 'All'='all';
returns 0
vs
select 'All'='All';
returns 1
With the Oracle provided query it returns 1 in both cases.
If I run the following on the connections I am making, I get different results
show session variables like '%collation%'"
I might be able to work around the issue, by submitting "SET NAMES DEFAULT; " before every query, but it doesn't seem like the best way to handle it.
The text was updated successfully, but these errors were encountered: