title: MySQL semicolon in update statement is causing syntax error
body: <p>I have a MySQL DB (5.7.18) with articles table. Each article has an abstract as an HTML string in <code>abstract</code> column. Due to a bug in the HTML editor, many of HTML tags are polluted with annoying style, like this:</p>
  
  <pre><code>&lt;h1 style="color: rgb(0, 0, 0);"&gt;Wonderful Abstract&lt;/h1&gt;
  </code></pre>
  
  <p>In order to fix this I am trying the following query:</p>
  
  <pre><code>UPDATE `article` SET `abstract`=REPLACE(`abstract`,' style="color: rgb(0, 0, 0);"','')
  </code></pre>
  
  <p>Unfortunately, a syntax error is shown:</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 '' style="color: rgb(0, 0, 0))' at line 1</p>
  </blockquote>
  
  <p>If the semicolon is removed it works fine:</p>
  
  <pre><code>UPDATE `article` SET `abstract`=REPLACE(`abstract`,' style="color: rgb(0, 0, 0)"','');
  </code></pre>
  
  <p>But it must be replaced in the string too...</p>
  
  <p>I found a reference <a href="https://forums.mysql.com/read.php?37,132124,166891#msg-166891" rel="nofollow noreferrer">here</a> saying to escape it:</p>
  
  <pre><code>UPDATE `article` SET `abstract`=REPLACE(`abstract`,' style="color: rgb(0, 0, 0)\;"','')
  </code></pre>
  
  <p>But the error message is still shown.</p>
  
  <p>Another option described in the same origin is to add a semicolon to the end of the statement:</p>
  
  <pre><code>UPDATE `article` SET `abstract`=REPLACE(`abstract`,' style="color: rgb(0, 0, 0);"','');
  </code></pre>
  
  <p>And the combination of those two:</p>
  
  <pre><code>UPDATE `article` SET `abstract`=REPLACE(`abstract`,' style="color: rgb(0, 0, 0)\;"','');
  </code></pre>
  
  <p>The error message is still there.</p>