报错内容
1267 - Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '='
执行的sql为:
select f2.* from folder f2 where f2.parent_id in (
select id from folder where parent_id is null and rel_type='FOLDER' and org_id!='0'
)
原因
由于新生成的查询的结果字符集为utf8_general_ci
,而原有表的字符集为utf8_unicode_ci
。
解决办法
修改表的字符集为utf8
alter table folder convert to character set utf8;