MySQL5.6のtime,date,datetimeのミリ秒対応

MySQLでようやくミリ秒に対応したようです。

Incompatible change: For TIME, DATETIME, and TIMESTAMP columns, the storage required for tables created before MySQL 5.6.4 differs from storage required for tables created in 5.6.4 and later. This is due to a change in 5.6.4 that permits these temporal types to have a fractional part. After upgrading from MySQL 5.5 to MySQL 5.6.4 or later, it is recommended that you also upgrade from MySQL 5.5 to MySQL 5.6 TIME, DATETIME, and TIMESTAMP types. ALTER TABLE currently allows the creation of tables containing temporal columns in both MySQL 5.5 and MySQL 5.6.4 (or later) binary format but this makes it more difficult to recreate tables in cases where .frm files are not available. Additionally, as of MySQL 5.6.4, the aforementioned temporal types are more space efficient. For more information about changes to temporal types in MySQL 5.6.4, see Storage Requirements for Date and Time Types.

http://dev.mysql.com/doc/refman/5.6/en/upgrading-from-previous-series.html より

それに伴い、バイト数も変更になりました。

http://dev.mysql.com/doc/refman/5.6/en/storage-requirements.html#data-types-storage-reqs-date-time

ミリ秒を指定してテーブルを作る際には以下のように指定をします。

CREATE TABLE `hoge` (
  `id` int(11) AUTO_INCREMENT,
  `create_time` time(3),
  `update_time` timestamp(6),
  `create_at` datetime(1),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB