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

VARCHAR(2) NOT NULL: explicit empty string gets converted to DEFAULT

Details

    Description

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (a VARCHAR(2) NOT NULL DEFAULT 'aa') ENGINE=ColumnStore;
      INSERT INTO t1 VALUES ('');
      SELECT HEX(a) FROM t1;
      

      +--------+
      | HEX(a) |
      +--------+
      | 6161   |
      +--------+
      

      Notice, emptry string was conversion to default 'aa'. Looks wrong.

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (a VARCHAR(2) NOT NULL DEFAULT ' ') ENGINE=ColumnStore;
      INSERT INTO t1 VALUES ('');
      SELECT HEX(a) FROM t1;
      

      +--------+
      | HEX(a) |
      +--------+
      | 20     |
      +--------+
      

      Notice, emptry string was conversion to default ' '. Looks wrong.

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (a VARCHAR(2) NOT NULL DEFAULT '  ') ENGINE=ColumnStore;
      INSERT INTO t1 VALUES ('  ');
      SELECT HEX(a) FROM t1;
      

      +--------+
      | HEX(a) |
      +--------+
      | 2020   |
      +--------+
      

      Notice, emptry string was conversion to default ' '. Looks wrong.

      In all above scenarios, INSERTs should:

      • either fail on NOT NULL violation for now
      • or insert an empty string (when we fix the flaw that emptry string is NULL)

      But it should not replace to DEFAULT!

      Attachments

        Issue Links

          Activity

            Build verified:
            engine: 1e56a0b557efb677d07533d05eb02ad723955317
            server: 11c83d9ae9eb249d00589cc6ab71e7f4e67ffa27
            buildNo: 7534
            This scenario has been fixed as part of MCOL-271. ColumnStore and InnoDB results matched.

            dleeyh Daniel Lee (Inactive) added a comment - Build verified: engine: 1e56a0b557efb677d07533d05eb02ad723955317 server: 11c83d9ae9eb249d00589cc6ab71e7f4e67ffa27 buildNo: 7534 This scenario has been fixed as part of MCOL-271 . ColumnStore and InnoDB results matched.

            People

              sergey.zefirov Sergey Zefirov
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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