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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 5.5.1, 5.6.1
    • Fix Version/s: 23.02
    • Component/s: PrimProc
    • Labels:
      None

      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

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              bar Alexander Barkov
              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.