My database is MySql 5.6.
I want to use CURRENT_TIMESTAMP as the default value an attribute which is type of TIMESTAMP(3).
But I get the error:
ERROR 1067 (42000): Invalid default value for 'updated'
I think it is because CURRENT_TIMESTAMP
is only in precision of second.
How can I set current time as the default value for a timestamp
with fractional part?
Best Answer
As per documentation on
timestamp
anddatetime
type columns:Other Examples:
Refer to:
Initialization and Updating for TIMESTAMP and DATETIME