我最近拂去了我的一个旧的Ruby on Rails项目.在过去,我从来没有遇到任何问题通过所有测试,但现在有一个测试,给我以下错误:
ActiveRecord :: StatementInvalid:Mysql :: Error:#HY000非法混合排序(latin1_swedish_ci,IMPLICIT)和(utf8_general_ci,COERCIBLE)操作'=':SELECT*FROM cards WHERE(cards.l1_description ='是'AND cards.l2_word = '')
所以我去我的测试数据库并询问:
mysql> use flashcard_test
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> show full columns from cards;
+----------------+--------------+-------------------+------+-----+---------+----------------+---------------------------------+---------+
| Field | Type | Collation | Null | Key | Default | Extra | Privileges | Comment |
+----------------+--------------+-------------------+------+-----+---------+----------------+---------------------------------+---------+
| id | int(11) | NULL | NO | PRI …Run Code Online (Sandbox Code Playgroud)