title: MySQL Stored procedure Need to compare 2 columns with different collation sequences
body: <p>I have a MySql stored procedure like so </p>
  
  <pre><code>CREATE DEFINER=`uwcrossword`@`%` PROCEDURE `sp_UpdCodePage`(IN in_id int, 
  IN nm varchar(25), IN nis varchar(25), IN lang varchar(25), 
  IN stpt varchar(5), IN endpt varchar(5))
  BEGIN
  UPDATE `uwcrossword`.`CODEPAGE`
  SET
  `ID` = in_id,
  `Name` = nm,
  `NameInScript` = nis,
  `Language` = lang,
  `StartPoint` = stpt,
  `EndPoint` = endpt
  WHERE [`ID` = in_id COLLATE utf8-general-ci] 
  AND [Language = lang COLLATE utf8-unicode-ci];
  END
  </code></pre>
  
  <p><code>ID</code> column has no specific collation.  <code>Language</code> Column has collation <code>utf8-unicode-ci</code>.</p>
  
  <h3> ERROR I GET</h3>
  
  <p>MySQL said:</p>
  
  <blockquote>
    <p>1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[`ID` = in_id COLLATE utf8-general-ci] AND [Language = lang COLLATE utf8-unicode' at line 11 </p>
  </blockquote>
  
  <p>When I try to run the same without any collation information</p>
  
  <pre><code>CREATE DEFINER=`uwcrossword`@`%` PROCEDURE `sp_UpdCodePage`(IN in_id int, 
  IN nm varchar(25), IN nis varchar(25), IN lang varchar(25), 
  IN stpt varchar(5), IN endpt varchar(5))
  BEGIN
  UPDATE `uwcrossword`.`CODEPAGE`
  SET
  `ID` = in_id,
  `Name` = nm,
  `NameInScript` = nis,
  `Language` = lang,
  `StartPoint` = stpt,
  `EndPoint` = endpt
  WHERE [`ID` = in_id] 
  AND [Language = lang];
  END
  </code></pre>
  
  <p>MySQL said:</p>
  
  <blockquote>
    <p>1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[`ID` = in_id ] 
        AND [Language = lang]' at line 13 </p>
  </blockquote>