title: Data truncation warning without width change
body: <p>I have a <code>BINARY(2) DEFAULT NULL</code> column in a MariaDB InnoDB table to store country code, but I would like to remove nullability (the value is always set), so I am trying to run the following query:</p>
  <pre class="lang-sql prettyprint-override"><code>ALTER TABLE `table_name` MODIFY COLUMN `country_code` BINARY(2) NOT NULL;
  </code></pre>
  <p>However, I have the following error:</p>
  <pre><code>Error 1265: Data truncated for column 'country_code' at row 357
  </code></pre>
  <p>There are no rows with values that exceed 2 characters, checked with</p>
  <pre class="lang-sql prettyprint-override"><code>SELECT MAX(LENGTH(`country_code`)) FROM `table_name`
  </code></pre>
  <p>Which returns 2.</p>
  <p>In that case, what is the possible cause of data truncation, and how to workaround?</p>