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

CREATE..SELECT for stored functions returning ENUM/SET does not preserve the exact type

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 10.0, 10.1, 10.2, 10.3
    • Fix Version/s: 10.3, 10.4
    • Component/s: Data types
    • Labels:
      None

      Description

      DROP FUNCTION IF EXISTS f1;
      CREATE FUNCTION f1() RETURNS ENUM('a') RETURN 'a';
      CREATE OR REPLACE TABLE t1 AS SELECT f1();
      SHOW CREATE TABLE t1;
      

      +-------+---------------------------------------------------------------------------------------------+
      | Table | Create Table                                                                                |
      +-------+---------------------------------------------------------------------------------------------+
      | t1    | CREATE TABLE `t1` (
        `f1()` varchar(1) DEFAULT NULL
      ) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
      +-------+---------------------------------------------------------------------------------------------+
      

      Looks wrong. The expected column type is ENUM('a').

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated: