Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 10.1, 10.0
-
Fix Version/s: 10.0.18
-
Component/s: Data Definition - Alter Table, Temporal Types
-
Labels:None
Description
This script:
DROP TABLE IF EXISTS t1,t2; CREATE TABLE t1 ( vc VARCHAR(10) NOT NULL DEFAULT 'test', ts timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE t2 AS SELECT * FROM t1 LIMIT 0; SHOW CREATE TABLE t2;
returns
+-------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Table | Create Table | +-------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+ | t2 | CREATE TABLE `t2` ( `vc` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT 'test', `ts` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 | +-------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
Notice: DEFAULT is preserved, ON UPDATE is not.
The expected behaviour is to preserve both.
Gliffy Diagrams
Attachments
Issue Links
- relates to
-
MDEV-7778 impossible create copy of table, if table contain default value for timestamp field
-
- Closed
-
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
The patch for mdev-7778 fixes this problem as well. Waiting for Serg to review 7778.