Bug #33887 | SHOW CREATE TABLE doesn't recreate TIMESTAMP columns correctly | ||
---|---|---|---|
Submitted: | 16 Jan 2008 14:24 | Modified: | 10 Jan 2013 11:10 |
Reporter: | Baron Schwartz (Basic Quality Contributor) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: DDL | Severity: | S2 (Serious) |
Version: | 5.0.54, 5.0.40 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | qc |
[16 Jan 2008 14:24]
Baron Schwartz
[17 Jan 2008 7:18]
Valeriy Kravchuk
Thank you for a bug report. Verified just as described on 5.0.54.
[17 Jan 2008 22:47]
Peter Laursen
I'd like to comment on this: "I think that the behavior of automatically adding the default value (default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP) when no default value is specified is a bug, because it doesn't allow you to say "no default value" for the first TIMESTAMP column in a table." Maybe you can consider it a bug but it would cause LOTS of problems to change that! With all sorts of client and applications! I also rather think it is a (parser?) bug with the specific syntax that you use! actually dropping the default for 1st column using this statement: alter table `test`.`test` change `t1` `t1` timestamp NOT NULL returns the expected Error Code : 1293 Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
[20 Nov 2012 8:32]
Abhishek Ranjan
This bug is about keeping the first column with timestamp as NOT NULL itself, rather than promoting it. Mysql-5.6 ,introduced --explicit-defaults-for-timestamp option, which when enabled, solves the above issue. The current behavior also differs from as shown in the bug report as server don't throw the error ER_TOO_MUCH_AUTO_TIMESTAMP_COLS anymore, even without --explicit-defaults-for-timestamp option. This was also implemented in 5.6.
[10 Jan 2013 11:10]
Erlend Dahl
Fixed in 5.6.6.