Re: Invalid default value
You might've been even more specific, absent that you'll need to find your case in this ...
Before 5.6.5: Timestamps could be NULLed only if created as TIMESTAMP NULL and were otherwise autodeclared NOT NULL. They took zero or valid DATETIME values. One TIMESTAMP column per table could be defaulted on INSERT or UPDATE. If there was no explicit default, the first TIMESTAMP was autoassigned DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, and subsequent TIMESTAMPs were autoassigned DEFAULT ‘0000-00-00 00:00:00’.
Since 5.6.5: Any number of TIMESTAMP columns can be defined with any combination of DEFAULT CURRENT_TIMESTAMP and ON UPDATE CURRENT_TIMESTAMP. DEFAULT <constant> and ON UPDATE <constant> apply <constant> on INSERT and UPDATE respectively.
Since 5.6.6: If the new system variable explicit_defaults_for_timestamp is set ON, TIMESTAMPs not explicitly declared NOT NULL accept NULLs, no TIMESTAMP column is autoassigned DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, and TIMESTAMPs declared NOT NULL without a DEFAULT clause have no default value (if sql_mode is strict, an error occurs).
Subject
Views
Written By
Posted
3118
August 13, 2014 12:34PM
1080
August 13, 2014 12:40PM
Re: Invalid default value
1775
August 13, 2014 01:01PM
1414
August 13, 2014 02:12PM
966
August 14, 2014 11:31AM
1020
August 14, 2014 12:29PM
1022
August 14, 2014 02:43PM
950
August 15, 2014 09:58PM
1529
August 15, 2014 10:39PM
988
August 16, 2014 05:15AM
1073
August 16, 2014 07:56AM
955
August 16, 2014 05:18AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.