Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.0(EOL), 10.1(EOL)
-
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.
Attachments
Issue Links
- relates to
-
MDEV-7778 impossible create copy of table, if table contain default value for timestamp field
- Closed