title: Issue when escaping '%' character
body: <p>I have an image table with a name column. The value inside the name column may contain a percentage sign, which by itself is a wild card character when using the like operator. I currently have the following relevant values in the name column: "a%" and "blah%blah".</p>
  
  <p>I do not get any results, as expected, when performing: </p>
  
  <pre><code>select name from image where name like '\%'
  </code></pre>
  
  <p>When performing the following, I am getting 2 of the above mentioned records:</p>
  
  <pre><code>select name from image where name like '%\%'
  </code></pre>
  
  <p>I understand why I am getting the record with "a%" as the name. However, I do not understand why I am getting "blah%blah". If "blah%blah" had a percentage character as the last character, it would make sense, but it does not.</p>
  
  <p>Am I doing something wrong here or is this a MySQL bug?</p>