Bug #68670 | CREATE TABLE ... AS SELECT not propagating default when CURRENT_TIMESTAMP | ||
---|---|---|---|
Submitted: | 14 Mar 2013 9:50 | Modified: | 18 Mar 2013 13:16 |
Reporter: | Paul Keenan | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: DDL | Severity: | S3 (Non-critical) |
Version: | 5.1.69 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[14 Mar 2013 9:50]
Paul Keenan
[15 Mar 2013 11:37]
MySQL Verification Team
Hello Paul, Thank you for the report. Verified as described Workaround: ============= mysql> create table t1 (f1 timestamp not null default current_timestamp, f2 timestamp not null default '2013-01-01 00:00:00'); Query OK, 0 rows affected (0.03 sec) mysql> mysql> mysql> desc t1; +-------+-----------+------+-----+---------------------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+-----------+------+-----+---------------------+-------+ | f1 | timestamp | NO | | CURRENT_TIMESTAMP | | | f2 | timestamp | NO | | 2013-01-01 00:00:00 | | +-------+-----------+------+-----+---------------------+-------+ 2 rows in set (0.01 sec) mysql> create table t2 like t1; Query OK, 0 rows affected (0.02 sec) mysql> desc t2; +-------+-----------+------+-----+---------------------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+-----------+------+-----+---------------------+-------+ | f1 | timestamp | NO | | CURRENT_TIMESTAMP | | | f2 | timestamp | NO | | 2013-01-01 00:00:00 | | +-------+-----------+------+-----+---------------------+-------+ 2 rows in set (0.01 sec) mysql> later if you need data: insert into t2 select * from t1; Regards, Umesh
[18 Mar 2013 13:16]
Guilhem Bichot
Duplicate of Oracle-internal bug#16163936. Exists since at least 5.1. Already fixed in 5.6.11.