Datetime field overflow if date > '9999-12-31 23:59:59.4'
<p>For my table <code>admin_tool_functionality</code></p>

<pre><code>CREATE TABLE admin_tool_functionality (

    id BIGINT NOT NULL AUTO_INCREMENT,

    admin_tool_functionality_type_id BIGINT NOT NULL,

    CONSTRAINT fk__admin_tool_functionality__admin_tool_functionality_type
        FOREIGN KEY (admin_tool_functionality_type_id)
        REFERENCES admin_tool_functionality_type(id),

    PRIMARY KEY (id, admin_tool_functionality_type_id),

    price FLOAT NOT NULL,

    valid_from_day DATETIME NOT NULL, 

    valid_until_day DATETIME NOT NULL,

    CHECK(valid_from_day &lt; valid_until_day)

);
</code></pre>

<p>This insertion works fine:</p>

<pre><code>INSERT INTO admin_tool_functionality 
    (admin_tool_functionality_type_id, price, valid_from_day, valid_until_day)
VALUES
    (1, 13.37, '2016-01-01', '9999-12-31 23:59:59.4');
</code></pre>

<p>But any value lager than <code>'9999-12-31 23:59:59.4'</code> is failing:</p>

<pre><code>INSERT INTO admin_tool_functionality 
    (admin_tool_functionality_type_id, price, valid_from_day, valid_until_day)
VALUES
    (1, 13.37, '2016-01-01', '9999-12-31 23:59:59.5');
</code></pre>

<p>Giving me:</p>

<pre><code>Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Datetime function: datetime field overflow
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3964)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3902)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2526)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2673)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2545)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2503)
    at com.mysql.jdbc.StatementImpl.executeInternal(StatementImpl.java:839)
    at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:739)
</code></pre>

<p>despite the <a href="http://dev.mysql.com/doc/refman/5.7/en/datetime.html" rel="nofollow">documentation</a> saying</p>

<blockquote>
  <p>the range for <code>DATETIME</code> values is <code>'1000-01-01 00:00:00.000000'</code> to <code>'9999-12-31 23:59:59.999999'</code></p>
</blockquote>

<p>Why am I getting this error?</p>