[MCOL-4716] CREATE TABLE with CURRENT_TIMESTAMP does not support own syntax Created: 2021-05-11  Updated: 2021-05-11  Resolved: 2021-05-11

Status: Closed
Project: MariaDB ColumnStore
Component/s: ?, DDLProc
Affects Version/s: 5.5.2
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Oli Sennhauser Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Environment:

Ubuntu 18.04, n.a.


Issue Links:
Duplicate
duplicates MCOL-1039 DATE / DATETIME should support CURREN... Closed
Relates
relates to MCOL-4039 cannot use timestamp in create table ... Closed

 Description   

Columnstore does NOT support its own CREATE TABLE syntax (breaks restore of mysqldump):

SQL> CREATE TABLE `employee` (
`employee_id` int(11) NOT NULL,
`full_name` varchar(30) NOT NULL,
`first_name` varchar(30) NOT NULL,
`last_name` varchar(30) NOT NULL,
`position_id` int(11) DEFAULT NULL,
`position_title` varchar(30) DEFAULT NULL,
`store_id` int(11) NOT NULL,
`department_id` int(11) NOT NULL,
`birth_date` date NOT NULL,
`hire_date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`end_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`salary` decimal(10,2) NOT NULL,
`supervisor_id` int(11) DEFAULT NULL,
`education_level` varchar(30) NOT NULL,
`marital_status` varchar(30) NOT NULL,
`gender` varchar(30) NOT NULL,
`management_role` varchar(255) DEFAULT NULL
) ENGINE=ColumnStore DEFAULT CHARSET=utf8
;
ERROR 1178 (42000): The storage engine for the table doesn't support The syntax or the data type(s) is not supported by Columnstore. Please check the Columnstore syntax guide for supported syntax or data types.

Removing DEFAULT current_timestamp() ON UPDATE current_timestamp()

SQL> CREATE TABLE `employee` (
`employee_id` int(11) NOT NULL,
`full_name` varchar(30) NOT NULL,
`first_name` varchar(30) NOT NULL,
`last_name` varchar(30) NOT NULL,
`position_id` int(11) DEFAULT NULL,
`position_title` varchar(30) DEFAULT NULL,
`store_id` int(11) NOT NULL,
`department_id` int(11) NOT NULL,
`birth_date` date NOT NULL,
`hire_date` timestamp NOT NULL,
`end_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`salary` decimal(10,2) NOT NULL,
`supervisor_id` int(11) DEFAULT NULL,
`education_level` varchar(30) NOT NULL,
`marital_status` varchar(30) NOT NULL,
`gender` varchar(30) NOT NULL,
`management_role` varchar(255) DEFAULT NULL
) ENGINE=ColumnStore DEFAULT CHARSET=utf8
;
Query OK, 0 rows affected (1.015 sec)

SQL> SHOW CREATE TABLE employee\G
Table: employee
Create Table: CREATE TABLE `employee` (
`employee_id` int(11) NOT NULL,
`full_name` varchar(30) NOT NULL,
`first_name` varchar(30) NOT NULL,
`last_name` varchar(30) NOT NULL,
`position_id` int(11) DEFAULT NULL,
`position_title` varchar(30) DEFAULT NULL,
`store_id` int(11) NOT NULL,
`department_id` int(11) NOT NULL,
`birth_date` date NOT NULL,
`hire_date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`end_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`salary` decimal(10,2) NOT NULL,
`supervisor_id` int(11) DEFAULT NULL,
`education_level` varchar(30) NOT NULL,
`marital_status` varchar(30) NOT NULL,
`gender` varchar(30) NOT NULL,
`management_role` varchar(255) DEFAULT NULL
) ENGINE=Columnstore DEFAULT CHARSET=utf8
1 row in set (0.001 sec)

Using this syntax again for creating a table results in the same error:

SQL> CREATE TABLE `employee` (
`employee_id` int(11) NOT NULL,
`full_name` varchar(30) NOT NULL,
`first_name` varchar(30) NOT NULL,
`last_name` varchar(30) NOT NULL,
`position_id` int(11) DEFAULT NULL,
`position_title` varchar(30) DEFAULT NULL,
`store_id` int(11) NOT NULL,
`department_id` int(11) NOT NULL,
`birth_date` date NOT NULL,
`hire_date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`end_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`salary` decimal(10,2) NOT NULL,
`supervisor_id` int(11) DEFAULT NULL,
`education_level` varchar(30) NOT NULL,
`marital_status` varchar(30) NOT NULL,
`gender` varchar(30) NOT NULL,
`management_role` varchar(255) DEFAULT NULL
) ENGINE=Columnstore DEFAULT CHARSET=utf8;
ERROR 1178 (42000): The storage engine for the table doesn't support The syntax or the data type(s) is not supported by Columnstore. Please check the Columnstore syntax guide for supported syntax or data types.

This breaks restore of a mariadbdump.



 Comments   
Comment by David Hall (Inactive) [ 2021-05-11 ]

Duplicate of MCOL-1039

Generated at Thu Feb 08 02:52:26 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.