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

Empty string not accepted as DEFAULT value for non-empty tables

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 23.10.0
    • None
    • None

    Description

      MariaDB [test]> CREATE TABLE person (
          ->     name VARCHAR(100) NOT NULL,
          ->     surname VARCHAR(100) NOT NULL
          -> ) ENGINE ColumnStore;
      Query OK, 0 rows affected (0.222 sec)
       
      MariaDB [test]> INSERT INTO person (name, surname) VALUES ('Miles', 'Davis');
      Query OK, 1 row affected (0.160 sec)
       
      MariaDB [test]> ALTER TABLE person ADD COLUMN middle_name VARCHAR(100) NOT NULL DEFAULT '';
      ERROR 1815 (HY000): Internal error: New column has to have a default value if NOT NULL required.
      

      This only happens when the default value is an empty string. But the empty string is a valid value, and it works with other storage engines:

      MariaDB [test]> ALTER TABLE person ENGINE InnoDB;
      Query OK, 1 row affected (0.303 sec)               
      Records: 1  Duplicates: 0  Warnings: 0
       
      MariaDB [test]> ALTER TABLE person ADD COLUMN middle_name VARCHAR(100) NOT NULL DEFAULT '';
      Query OK, 0 rows affected (0.038 sec)
      Records: 0  Duplicates: 0  Warnings: 0
      

      Attachments

        Activity

          People

            leonid.fedorov Leonid Fedorov
            f_razzoli Federico Razzoli
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.