Re: Can someone please explain this misbehavior?
Posted by: Rick James
Date: August 20, 2014 07:23PM

I see two possible issues...
* The meaning of _ci collation on accents.
* How to get a particular collation to apply.

I think that http://collation-charts.org/mysql60/mysql604.utf8_general_ci.european.html says that the various accented Cyrillic e's (Dxxx) are treated as equal in the utf8_general_ci. Meanwhile, the western European e's are equal to each other, but not to the Cyrillic ones.

It is unfortunate that _ci (in MySQL) means _both_ Case Insensitive and Accent Insensitive. Is that the issue you are raising?

This, not the "collation_connection", says how @wrong and @right will be compared:
mysql> SELECT COLLATION(@wrong), COLLATION(@right);
+-------------------+-------------------+
| COLLATION(@wrong) | COLLATION(@right) |
+-------------------+-------------------+
| utf8_unicode_ci   | utf8_unicode_ci   |
+-------------------+-------------------+
1 row in set (0.00 sec)

Or, to force the collation during the "=" test, regardless of the collation for the operands:
mysql> SELECT
    -> IF(@wrong = @right COLLATE utf8_bin, 'Bogus comparison (equal)', 'Right is right (unequal)') AS 'bin',
    -> IF(@wrong = @right COLLATE utf8_general_ci, 'Bogus comparison (equal)', 'Right is right (unequal)') AS 'general_ci';
+--------------------------+--------------------------+
| bin                      | general_ci               |
+--------------------------+--------------------------+
| Right is right (unequal) | Bogus comparison (equal) |
+--------------------------+--------------------------+
1 row in set (0.00 sec)

Have I answered your question? If not, please rephrase it.

Options: ReplyQuote


Subject
Views
Written By
Posted
2995
A B
August 19, 2014 07:53PM
Re: Can someone please explain this misbehavior?
1405
August 20, 2014 07:23PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.