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

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.0, 10.1, 10.2, 10.3
    • 10.4
    • Data types
    • 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

            bar Alexander Barkov
            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.