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

            bar Alexander Barkov created issue -
            bar Alexander Barkov made changes -
            Field Original Value New Value
            toddstoffel Todd Stoffel (Inactive) made changes -
            Rank Ranked higher
            gdorman Gregory Dorman (Inactive) made changes -
            Sprint 2021-5 [ 504 ]
            gdorman Gregory Dorman (Inactive) made changes -
            Rank Ranked higher
            gdorman Gregory Dorman (Inactive) made changes -
            Epic Link MCOL-1049 [ 64464 ]
            gdorman Gregory Dorman (Inactive) made changes -
            Sprint 2021-5 [ 504 ] 2021-5, 2021-6 [ 504, 509 ]
            toddstoffel Todd Stoffel (Inactive) made changes -
            Rank Ranked higher
            gdorman Gregory Dorman (Inactive) made changes -
            Sprint 2021-5, 2021-6 [ 504, 509 ] 2021-5, 2021-6, 2021-7 [ 504, 509, 514 ]
            David.Hall David Hall (Inactive) made changes -
            Fix Version/s 6.1.1 [ 25600 ]
            Fix Version/s 5.6.1 [ 25031 ]
            gdorman Gregory Dorman (Inactive) made changes -
            gdorman Gregory Dorman (Inactive) made changes -
            Sprint 2021-5, 2021-6, 2021-7 [ 504, 509, 514 ] 2021-5, 2021-6 [ 504, 509 ]
            gdorman Gregory Dorman (Inactive) made changes -
            Rank Ranked higher
            gdorman Gregory Dorman (Inactive) made changes -
            Fix Version/s 6.5.1 [ 25801 ]
            Fix Version/s 6.1.1 [ 25600 ]
            toddstoffel Todd Stoffel (Inactive) made changes -
            Rank Ranked lower
            toddstoffel Todd Stoffel (Inactive) made changes -
            Rank Ranked lower
            toddstoffel Todd Stoffel (Inactive) made changes -
            Rank Ranked lower
            toddstoffel Todd Stoffel (Inactive) made changes -
            Assignee Alexander Barkov [ bar ]
            toddstoffel Todd Stoffel (Inactive) made changes -
            Rank Ranked higher
            toddstoffel Todd Stoffel (Inactive) made changes -
            Rank Ranked higher
            David.Hall David Hall (Inactive) made changes -
            Fix Version/s 6.4.1 [ 26046 ]
            Fix Version/s 6.3.1 [ 25801 ]
            toddstoffel Todd Stoffel (Inactive) made changes -
            Rank Ranked higher
            toddstoffel Todd Stoffel (Inactive) made changes -
            Fix Version/s 22.08 [ 26904 ]
            Fix Version/s 6.4.1 [ 26046 ]
            toddstoffel Todd Stoffel (Inactive) made changes -
            Fix Version/s 23.02 [ 28209 ]
            Fix Version/s 22.08 [ 26904 ]
            toddstoffel Todd Stoffel (Inactive) made changes -
            Fix Version/s 23.08 [ 28540 ]
            Fix Version/s 23.02 [ 28209 ]
            dleeyh Daniel Lee (Inactive) made changes -
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Closed [ 6 ]
            alexey.vorovich alexey vorovich (Inactive) made changes -
            Fix Version/s 23.08.1 [ 29105 ]
            Fix Version/s 23.08.1 [ 29105 ]
            Fix Version/s 23.08 [ 28540 ]
            alexey.vorovich alexey vorovich (Inactive) made changes -
            alexey.vorovich alexey vorovich (Inactive) made changes -
            Assignee Sergey Zefirov [ JIRAUSER47362 ]
            alexey.vorovich alexey vorovich (Inactive) made changes -
            Labels rm_invalid_data
            toddstoffel Todd Stoffel (Inactive) made changes -
            Fix Version/s 23.10.0 [ 29422 ]
            toddstoffel Todd Stoffel (Inactive) made changes -
            Fix Version/s 23.10.1 [ 29105 ]

            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.