Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-20253

DEFAULT is erroneously copied in `CREATE..SELECT column`

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5
    • 10.11
    • Data types
    • None

    Description

      DEFAULT is erroneously copied in `CREATE..SELECT column`

      CREATE OR REPLACE TABLE t1 (a VARCHAR(10) DEFAULT 'x');
      CREATE OR REPLACE TABLE t2 AS SELECT a FROM t1;
      SHOW CREATE TABLE t2;
      

      +-------+------------------------------------------------------------------------------------------+
      | Table | Create Table                                                                             |
      +-------+------------------------------------------------------------------------------------------+
      | t2    | CREATE TABLE `t2` (
        `a` varchar(10) DEFAULT 'x'
      ) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
      +-------+------------------------------------------------------------------------------------------+
      

      Notice, the default value was copied from `t1.a` to `t2.a`. It does not look correct. It should not copy DEFAULT.

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.