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

Wrong data type for CREATE..SELECT year_sp_variable

    XMLWordPrintable

Details

    Description

      DROP PROCEDURE IF EXISTS p1;
      DELIMITER $$
      CREATE PROCEDURE p1()
      BEGIN
        DECLARE a YEAR;
        CREATE OR REPLACE TABLE t1 AS SELECT a;
        SHOW CREATE TABLE t1;
        DROP TABLE t1;
      END;
      $$
      DELIMITER ;
      CALL p1;
      

      +-------+-----------------------------------------------------------------------------------------------+
      | Table | Create Table                                                                                  |
      +-------+-----------------------------------------------------------------------------------------------+
      | t1    | CREATE TABLE `t1` (
        `a` int(4) unsigned DEFAULT NULL
      ) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
      +-------+-----------------------------------------------------------------------------------------------+
      

      The data type for t1.a is wrong. The expected type is YEAR.

      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.