title: MySQL 5.5 & 5.6 default values
body: <p>I'd like some clarification on the behaviour of default values in MySQL 5.5 &amp; 5.6. Lets say we have the following table on a MySQL 5.5 server:</p>
  
  <pre><code>CREATE TABLE `test` (
  `TestColumn` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
  ) ENGINE=INNODB DEFAULT CHARSET=utf8;
  </code></pre>
  
  <p>I am able to run the following query without issue:</p>
  
  <pre><code>INSERT INTO `test` VALUES (NULL);
  </code></pre>
  
  <p>Which creates the following row:</p>
  
  <pre><code> TestColumn
   2014-02-20 14:55:05
  </code></pre>
  
  <p>Now if I repeat the same test on a MySQL 5.6 server, the insert fails:</p>
  
  <pre><code>Error Code: 1048
  Column 'TestColumn' cannot be null
  </code></pre>
  
  <p>I understand that timestamp automatic initilisation has changed in 5.6 (<a href="http://dev.mysql.com/doc/refman/5.6/en/timestamp-initialization.html" rel="noreferrer">http://dev.mysql.com/doc/refman/5.6/en/timestamp-initialization.html</a>), but what I can't work out is how to replicate the behaviour seen in 5.5 in 5.6.</p>
  
  <p>Not sure if it matters but our 5.6 server has explicit_defaults_for_timestamp set to ON.</p>
  
  <p>Ideally what I'm after is a solution to this, but if anyone has a better understand and can explain it that would be useful as well.</p>
  
  <p>Thanks.</p>
  
  <p>EDIT: We are using MySQL 5.6.13</p>