my stored procedure in MySQL fails with Mysql::Error: Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT) for operation '='
.
The procedure fails when in SELECT
clause it tries to compare a VARCHAR
column with VARCHAR
parameter passed to this procedure.
All the columns in my tables have utf8_unicode_ci
collation. Database collation is the same. I have even specified collation in `/config/database.yml.
However, when I run /script/console
I have following variables set:
>> ActiveRecord::Base.connection.select_rows "show variables like '%colla%'"
=> [["collation_connection", "utf8_general_ci"], ["collation_database", "utf8_unicode_ci"], ["collation_server", "utf8_general_ci"]]
And possibly the most interesting fact is that I have another database on the same MySQL server with same collations (even querying for collation variables from Rails console gives same results) which runs this stored procedure without any problem.
Thanks for your help.
utf8_general_ci
set which is inproper in my database and this is the reason. Thank you for spending time on this question. – Chalcopyrite