我想你说的是这个:
Previously, at most one TIMESTAMP column per table could be automatically initialized or updated to the current date and time.
This restriction has been lifted. Any TIMESTAMP column definition can
have any combination of DEFAULT CURRENT_TIMESTAMP and ON UPDATE
CURRENT_TIMESTAMP clauses. In addition, these clauses now can be used
with DATETIME column definitions. For more information, see Automatic
Initialization and Updating for TIMESTAMP and DATETIME.
这是一个mysql 5.6.4之前的limitation. 我在5.5.24上试了,
mysql> create table mytime (id int, ctime timestamp default current_timestamp, u
time timestamp default current_timestamp on update current_timestamp);
会报:
RROR 1293 (HY000): Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
5.6.12上没有问题.
如果想在mysql 5.6.4之前用这个功能, 自己去弄一个trigger吧.