title: MySQL: integer to string type comparison in WHERE clause
body: <p>I have a question about MySQL comparing different data types. Let's say I have a following table:
  </p>
  
  <pre><code>CREATE TABLE `test`(  
    `value` VARCHAR(100)
  );
  </code></pre>
  
  <p>Then I insert some data:</p>
  
  <pre class="lang-sql prettyprint-override"><code>INSERT INTO test VALUES ('2XV4F2J');
  INSERT INTO test VALUES ('123456');
  </code></pre>
  
  <p>Now if I run a simple select query:</p>
  
  <pre class="lang-sql prettyprint-override"><code>SELECT * FROM test WHERE `value` = 2
  </code></pre>
  
  <p>I am aware of comparison of different types so in this case everything should be compared as 'floats' according to documentation. So as expected I get the result:</p>
  
  <pre><code>2XV4F2J
  </code></pre>
  
  <p>However when I try to run the update query 
  </p>
  
  <pre><code>UPDATE test SET `value` = 'some other value' WHERE `value` = 2
  </code></pre>
  
  <p>I get the following error message:</p>
  
  <pre><code>Error Code: 1292
  Truncated incorrect DOUBLE value: '2XV4F2J'
  </code></pre>
  
  <p>The thing I do not understand is why I am getting the error only when running UPDATE query. I would've expected to get the same error during SELECT as well.</p>