title: Long integer is transformed when inserted in shorter column, not truncated. Why? What is the formula?
body: <p>I have a column of type <code>integer</code> with length 10:</p>
  
  <pre><code>`some_number` int(10) unsigned NOT NULL
  </code></pre>
  
  <p>Into this column I insert a number that is too long:</p>
  
  <pre><code>$some_number = 715988985123857;
  $query = "INSERT INTO this_table SET some_number = ?";
  $stmt = $mysqli-&gt;prepare($query);
  $stmt-&gt;bind_param('i', $some_number);
  $stmt-&gt;execute();
  </code></pre>
  
  <p>When I look at what is in the table, the number is now:</p>
  
  <blockquote>
    <p>2147483647</p>
  </blockquote>
  
  <p>How and why did <code>715988985123857</code>turn into <code>2147483647</code>?<br>
  Why didn't it get truncated?<br>
  What is the mechanism behind this transformation, and can the resulting number be calculated with some formula?</p>
  
  <hr>
  
  <p>I'm not looking for a solution. I just want to understand the specific number.</p>