title: mysql CONVERT() and CAST() to integer are increasing the value by 1
body: <p>I'm trying to select records from a phone-call table where the value of an ENUM string field called <code>Call_Rating</code> is less than the integer value 4. The <code>Call_Rating</code> field can only contain the values '0','1','2','3','4','5'. Whenever I use <code>CONVERT(Call_Rating, UNSIGNED INTEGER)</code> or <code>CAST(Call_Rating AS UNSIGNED)</code>, the values of the <code>Call_Rating</code> field are increased by 1. Why is it doing this and is there a way to avoid it other than just manually subtracting 1 from the CALL() or CAST() functions?
  <strong>Also, this is an old DB that was set-up by someone else and is still in use by various systems, so some way of getting around this issue without changing the DB schema would be useful.</strong></p>
  <h3>Create Table</h3>
  <pre><code>CREATE TABLE `member_calls` (
    `CallID` int(10) NOT NULL AUTO_INCREMENT,
    `Call_Rating` enum('0','1','2','3','4','5') CHARACTER SET latin1 NOT NULL DEFAULT '0',
    PRIMARY KEY (`CallID`)
  ) ENGINE=MyISAM AUTO_INCREMENT=538616 DEFAULT CHARSET=utf8;
  </code></pre>
  <h3>Data in Table</h3>
  <pre><code>INSERT INTO `member_calls`
    (`CallID`, `Call_Rating`)
  VALUES
    (510515, '4'),
    (510909, '0'),
    (538614, '3'),
    (538615, '5');
  </code></pre>
  <h3>Select Statement</h3>
  <pre><code>SELECT `CallID`, `Call_Rating`, CAST(`Call_Rating` AS UNSIGNED) AS 'Casted', CONVERT(`Call_Rating`, UNSIGNED INTEGER) AS 'Converted'
  FROM `member_calls`
  WHERE CONVERT(`Call_Rating`, SIGNED INTEGER) &lt; 4
     OR CAST(`Call_Rating` AS UNSIGNED) &lt; 4;
  </code></pre>
  <h3>Given Results</h3>
  <pre><code>CallID  Call_Rating Casted  Converted
  510909  0           1       1
  </code></pre>
  <h3>Expected Results</h3>
  <pre><code>CallID  Call_Rating Casted  Converted
  510909  0           0       0
  538614  3           3       3
  </code></pre>
  <h1>Edit 2016-5-17</h1>
  <p>Thank you everyone for your input. I now understand why the issue was happening. Basically the ENUM was being treated like an array and CAST()/CONVERT() were returning the index of the array rather than the value. The best solution to this would be to change the ENUM to an INT field, but that is not desirable in my situation since the DB is being used live, and altering the data type could cause issues elsewhere. For that reason, lserni's solution was the most useful for me.</p>