-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
MariaDB vs MySQL adaptations #206
Conversation
- Due to the inability of MySQL to handle UTF-8 -> latin1 coercion ( which mariadb apparently has no problem with ). We cast all values that are provided as strings to 'BINARY' during comparison with column values that are stored as latin1. This was done for the following files: - acl-config - create_public_user.sql
- Making sure that BINARY is used only where necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussing it with @ryanrath, this seems like the least risky way of solving the problem. It works so long as:
- The character set of one string is a subset of the character set of the other string, and
- Both character sets use the same binary representations for shared characters.
Since I can only ever foresee us using latin1
, utf8
, or utf8mb4
, this should continue to work even if we change character set and collation settings in the future.
EDIT: Only the first 128 characters of latin1
- the ASCII characters - are binary compatible with utf8
and utf8mb4
. As long as we stick to those characters for this purpose before we switch to UTF-8, we're fine.
I agree, any change should be to |
* MariaDB vs MySQL adaptations - Due to the inability of MySQL to handle UTF-8 -> latin1 coercion ( which mariadb apparently has no problem with ). We cast all values that are provided as strings to 'BINARY' during comparison with column values that are stored as latin1. This was done for the following files: - acl-config - create_public_user.sql * SQL cleanup - Making sure that BINARY is used only where necessary.
* MariaDB vs MySQL adaptations - Due to the inability of MySQL to handle UTF-8 -> latin1 coercion ( which mariadb apparently has no problem with ). We cast all values that are provided as strings to 'BINARY' during comparison with column values that are stored as latin1. This was done for the following files: - acl-config - create_public_user.sql * SQL cleanup - Making sure that BINARY is used only where necessary.
Description
mariadb apparently has no problem with ). We cast all values that are provided
as strings to 'BINARY' during comparison with column values that are stored as
latin1 ( Which are also cast to BINARY ). This was done for the following files:
Motivation and Context
When executing these scripts against a MySQL box the queries involved errored out against a MySQL db but not against a MariaDB instance.
Tests performed
Manual Testing:
SELECT table_schema, table_name, column_name, character_set_name, collation_name FROM information_schema.columns WHERE table_schema IN ('<your_schema_here>') AND table_name IN ('<your table_name_here>') ORDER BY table_schema, table_name,ordinal_position;
- This will tell what encoding / collation is being used for the columns in table_schema.table_name
table.column = 'textual data'
and changing it toBINARY table.column = BINARY 'textual data'
Types of changes
Checklist: