Skip to content

collation connection set to utf8mb4_bin #585

@FireInWinter

Description

@FireInWinter

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%'"

Using 0.47.1.0 mysqlconnector
Variable_name        Value
-------------        -----
collation_connection utf8mb4_bin
collation_database   utf8mb4_general_ci
collation_server     utf8mb4_general_ci
Using MySQL.Data, Version=6.10.7.0
Variable_name        Value             
-------------        -----             
collation_connection utf8mb4_general_ci
collation_database   utf8mb4_general_ci
collation_server     utf8mb4_general_ci

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions