MySQL支持的字符集
mysql5.7 和mysql8.0 的字符集type不同
DESC information_schema.`CHARACTER_SETS`
mysql5.7和8.0字符集(character)的排序规则(collation)也不同
_ci:大小写不敏感,_cs:大小写敏感,_bin:二元,即比较的是基于字符串编码的值而与language无关。
select case when 'A' collate utf8_general_ci = 'a' collate utf8_general_ci then 1 else 0 end as caseinsensitive SELECT CASE WHEN 'A' COLLATE utf8_bin = 'a' COLLATE utf8_bin THEN 1 ELSE 0 END AS caseinsensitive