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

Wrong data type on CREATE..SELECT char_or_enum_or_text_spvar

    XMLWordPrintable

Details

    Description

      DROP TABLE IF EXISTS t1;
      DELIMITER $$
      BEGIN NOT ATOMIC
        DECLARE var TEXT CHARACTER SET utf8;
        CREATE TABLE t1 AS SELECT var;
      END;
      $$
      DELIMITER ;
      SHOW CREATE TABLE t1;
      

      +-------+---------------------------------------------------------------------------------------------------------------+
      | Table | Create Table                                                                                                  |
      +-------+---------------------------------------------------------------------------------------------------------------+
      | t1    | CREATE TABLE `t1` (
        `var` mediumtext CHARACTER SET utf8 DEFAULT NULL
      ) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
      +-------+---------------------------------------------------------------------------------------------------------------+
      

      Notice, the column data type in the table does not match the variable data type.
      The expected data type for t1.var should be TEXT CHARACTER SET utf8 rather than MEDIUMTEXT CHARACTER SET utf8.

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.