|
Actually the 1st table is specified WITH SYSTEM VERSIONING .
So the seconds table has to be the same as the first.
The statement however does not preserve SYSTEM VERSIONING
CREATE TABLE B SELECT * from A ;
MariaDB [ffr]> show create table fr ;
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| fr |
CREATE TABLE `fr` (
`c1` time(6) DEFAULT NULL,
`c2` datetime(6) DEFAULT NULL,
`c3` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 *WITH SYSTEM VERSIONING |
*
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |
MariaDB [ffr]> create table sheet select * from fr ;
Query OK, 2 rows affected (0.188 sec)
Records: 2 Duplicates: 0 Warnings: 0
MariaDB [ffr]> show create table sheet;
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| sheet |
CREATE TABLE `sheet` (
`c1` time(6) DEFAULT NULL,
`c2` datetime(6) DEFAULT NULL,
`c3` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
*WITH SYSTEM VERSIONING should be explicitly specified in the statement
CREATE TARGET_TABLE SELECT * from SOURCE_TABLE
Although the SOURCE_TABLE is WITH SYSTEM VERSIONING*
MariaDB [ffr]> create table sheet1 WITH SYSTEM VERSIONING select * from fr ;
Query OK, 2 rows affected (0.162 sec)
Records: 2 Duplicates: 0 Warnings: 0
MariaDB [ffr]> show create table sheet1;
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| sheet1 |
CREATE TABLE `sheet1` (
`c1` time(6) DEFAULT NULL,
`c2` datetime(6) DEFAULT NULL,
`c3` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING |
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.000 sec)
MariaDB [ffr]>
|