Mysql: comparing tinyint column with varchar value
<p>I was looking into some code and some bug caught my eye. Someone compared tinyint column with varchar value.</p>

<p>But surprisingly this is working (as intention was to compare with numeric value 0).</p>

<p><strong>Sample Query:</strong></p>

<pre><code> create table t1(x1 tinyint);

 insert into t1 values (0),(0), (1), (2);

 select * from t1 where x1 = 'live'
</code></pre>

<p><strong>Result:</strong></p>

<pre><code>x1

0

0
</code></pre>

<p><a href="http://sqlfiddle.com/#!9/c2e3f/1" rel="nofollow">Sqlfiddle</a></p>

<p>My question is why (any) varchar value behaves the same way as numeric value 0 for int/tinyint column?</p>