Uploaded image for project: 'MariaDB ColumnStore'
  1. MariaDB ColumnStore
  2. MCOL-4909

Columnstore handles nulls and zero-length strings different from the way Innodb handles them

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • Icebox
    • 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

          Activity

            People

              Unassigned Unassigned
              edward Edward Stoever
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.