[MCOL-4022] Add support for TIMESTAMP NULL Created: 2020-05-26 Updated: 2023-11-02 Resolved: 2023-10-26 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | DDLProc |
| Affects Version/s: | 1.4.3 |
| Fix Version/s: | Icebox |
| Type: | Bug | Priority: | Major |
| Reporter: | Gagan Goel (Inactive) | Assignee: | Unassigned |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Original support for TIMESTAMP data type that was added to ColumnStore (https://github.com/mariadb-corporation/mariadb-columnstore-engine/pull/739) did not add support for TIMESTAMP NULL. I.e., when the user creates a table like so:
Even though the NULL constraint is specified in the DDL, we internally set the constraint to NOT NULL in ColumnStore for this column. This is because the default constraint in the server is NOT NULL, when no constraint is specified in the DDL:
The DDL parser currently does not track whether the user specified the NULL constraint or not; we assume NULL as the default constraint. This internal conversion from NULL to NOT NULL is therefore done due to this limitation in the parser, as well as to respect the default server behaviour for TIMESTAMP datatype. Note that if the user accidentally creates a table which has one of the columns with TIMESTAMP NULL, and an LDI query is performed, we will have the "\N" values in the data file assigning NULL values to the wrong columns, because the server thinks this column is NULL, but our internal constraint on the column will be NOT NULL (the problematic function in question here is dbcon/mysql/ha_mcs_dml.cpp::ha_mcs_impl_write_batch_row_) In this issue, we should fix these limitations of the TIMESTAMP datatype, as well as also track the NULL keyword in the DDL parser. |
| Comments |
| Comment by Kirill Perov [ 2023-11-02 ] | ||||||
|
CREATE TABLE tn (i int,a TIMESTAMP NULL)engine=columnstore;
-----
----- Should be NULLs in 'a' column. For MDB there will be NULLs. show create table tn; |