Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
Columnstore engine does not store empty strings in varchar or text columns, it replaces them with null.
MariaDB [wh]> show session status like 'Columnstore_version';
|
Variable_name Value
|
Columnstore_version 6.1.1
|
MariaDB [wh]> truncate table p;
|
MariaDB [wh]> show create table p;
|
Table Create Table
|
p CREATE TABLE `p` (\n `col1` varchar(100) DEFAULT NULL\n) ENGINE=Columnstore DEFAULT CHARSET=utf8mb3
|
MariaDB [wh]> insert into p values (null);
|
MariaDB [wh]> insert into p values ('');
|
MariaDB [wh]> select * from p;
|
col1
|
NULL
|
NULL
|
MariaDB [wh]>
|
If the column is defined as varchar NOT NULL there is a conflict, which throws an error.
MariaDB [wh]> CREATE TABLE `q`(`col1` varchar(100) NOT NULL DEFAULT '')ENGINE=Columnstore DEFAULT CHARSET=utf8mb3;
|
MariaDB [wh]> insert into q values('');
|
ERROR 1815 (HY000): Internal error: CAL0001: Insert Failed: IDB-4015: Column 'col1' cannot be null.
|
MariaDB [wh]>
|
MariaDB [wh]> CREATE TABLE `u`(`col1` varchar(100) NOT NULL DEFAULT '')ENGINE=innodb DEFAULT CHARSET=utf8mb3;
|
MariaDB [wh]> insert into u values ('');
|
MariaDB [wh]> insert into u values (null);
|
ERROR 1048 (23000): Column 'col1' cannot be null
|
MariaDB [wh]>
|
Attachments
Issue Links
- duplicates
-
MCOL-4403 Trailing spaces not behaving as InnoDB
- Closed