Bug #80239 Error 1067 when attempting to create table with two not null timestamp columns.
Submitted: 2 Feb 2016 17:55 Modified: 2 Feb 2016 18:23
Reporter: Michael Vaughan Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.7.10 OS:MacOS (10.11.2)
Assigned to: CPU Architecture:Any

[2 Feb 2016 17:55] Michael Vaughan
Description:
When creating a table with two NOT NULL TIMESTAMP columns without specifying default values, I receive the following error: 

Error Code: 1067. Invalid default value for 't2'.

I can successfully create a table with only one NOT NULL TIMESTAMP column without a default value. I have only observed this behavior on OSX installations. I have verified it works as desired on a Linux Mint installation.

How to repeat:
On OSX the first create table statement will succeed while the second will fail with message: Error Code: 1067. Invalid default value for 't2'.

CREATE TABLE test1(t1 TIMESTAMP NOT NULL);
CREATE TABLE test2(t1 TIMESTAMP NOT NULL, t2 TIMESTAMP NOT NULL);

Suggested fix:
The expected behavior would be that you could create multiple not null timestamp columns.
[2 Feb 2016 18:23] MySQL Verification Team
Thank you for the bug report. Duplicate of http://bugs.mysql.com/bug.php?id=80163.