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

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

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 10.1, 10.2, 10.3, 10.4, 10.5
    • Fix Version/s: 10.3, 10.4
    • Component/s: Data types
    • Labels:
      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

              • Assignee:
                Unassigned
                Reporter:
                bar Alexander Barkov
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: