MySQL Forums
Forum List  »  InnoDB

Re: Invalid default value
Posted by: Tim Bomgardner
Date: August 13, 2014 02:12PM

Thanks for responding! I'm running 5.7.3. Given the three scenarios you describe...

1. The error occurs on CREATE TABLE. No data is being written, null or otherwise. However, it is the SECOND timestamp column where the error occurs, but what would be invalid in the autoassigned DEFAULT ‘0000-00-00 00:00:00’? And if that only applies to pre-5.6.5, would it be relevant?

2. We're not explicitly defining DEFAULTs for either timestamp column. And again, we're dealing with a CREATE TABLE error, so it doesn't seem like this is the right one.

3. explicit_defaults_for_timestamp is OFF on a system where the create succeeds; I'm inquiring about the value on systems where it fails. But this still seems to apply to INSERT and UPDATE, not CREATE TABLE. However, this seems to be close to the problem, as on one system wehere the CREATE TABLE failed, it was reported that removing STRICT_TRANS_TABLES from sql-mode fixed the problem.

So I still don't know exactly what the problem is, but it looks like a simple workaround will be to declare explicit DEFAULT clauses.

Options: ReplyQuote


Subject
Views
Written By
Posted
2841
August 13, 2014 12:34PM
994
August 13, 2014 12:40PM
1667
August 13, 2014 01:01PM
Re: Invalid default value
1317
August 13, 2014 02:12PM
871
August 14, 2014 11:31AM
925
August 14, 2014 12:29PM
923
August 14, 2014 02:43PM
845
August 15, 2014 09:58PM
1416
August 15, 2014 10:39PM
889
August 16, 2014 05:15AM
979
August 16, 2014 07:56AM
862
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.