title: Illegal mix of collations in stored procedure
body: <p>my stored procedure in MySQL fails with <code>Mysql::Error: Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT) for operation '='</code>.</p>
  
  <p>The procedure fails when in <code>SELECT</code> clause it tries to compare a <code>VARCHAR</code> column with <code>VARCHAR</code> parameter passed to this procedure.</p>
  
  <p>All the columns in my tables have <code>utf8_unicode_ci</code> collation. Database collation is the same. I have even specified collation in `/config/database.yml.</p>
  
  <p>However, when I run <code>/script/console</code> I have following variables set:</p>
  
  <pre><code>&gt;&gt; ActiveRecord::Base.connection.select_rows "show variables like '%colla%'"
  =&gt; [["collation_connection", "utf8_general_ci"], ["collation_database", "utf8_unicode_ci"], ["collation_server", "utf8_general_ci"]]
  </code></pre>
  
  <p>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.</p>
  
  <p>Thanks for your help.</p>