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

CREATE TABLE t1 AS SELECT spfunc() makes a field with a wrong data type

    XMLWordPrintable

Details

    Description

      DROP FUNCTION IF EXISTS f1;
      DROP TABLE IF EXISTS t1;
      CREATE FUNCTION f1() RETURNS VARCHAR(4000) RETURN 'test';
      CREATE TABLE t1 AS SELECT f1() AS c1;
      SHOW CREATE TABLE t1;
      

      returns

      CREATE TABLE `t1` (
       `c1` text DEFAULT NULL
      ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
      

      Notice, it creates a column of the TEXT data type. The expected data type is VARCHAR(4000).

      Attachments

        Activity

          People

            Unassigned Unassigned
            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.