title: Case-insensitive REPLACE in MySQL?
body: <p>MySQL runs pretty much all string comparisons under the default collation... except the <code>REPLACE</code> command.  I have a case-insensitive collation and need to run a case-insensitive <code>REPLACE</code>.  Is there any way to force <code>REPLACE</code> to use the current collation rather than always doing case-sensitive comparisons?  I'm willing to upgrade my MySQL (currently running 5.1) to get added functionality...</p>
  
  <pre><code>mysql&gt; charset utf8 collation utf8_unicode_ci;
  Charset changed
  
  mysql&gt; select 'abc' like '%B%';
  +------------------+
  | 'abc' like '%B%' |
  +------------------+
  |                1 |
  +------------------+
  
  mysql&gt; select replace('aAbBcC', 'a', 'f');
  +-----------------------------+
  | replace('aAbBcC', 'a', 'f') |
  +-----------------------------+
  | fAbBcC                      |   &lt;--- *NOT* 'ffbBcC'
  +-----------------------------+
  </code></pre>