title: How to know CAST failed in MySQL
body: <p>Could somebody tell me how I can detect if a cast failed in MySQL using <code>CAST()</code> function? </p>
  
  <p>These two lines return the same value: 0.</p>
  
  <pre><code>SELECT CAST('Banana' AS UNSIGNED INTEGER) AS 'CAST1';
  SELECT CAST('0' AS UNSIGNED INTEGER) AS 'CAST2';
  </code></pre>