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

"Incorrect column name" when "CREATE TABLE t1 AS SELECT spvar"

    XMLWordPrintable

Details

    Description

      This problem is specific to bb-10.2-compatibility:

      DROP VIEW IF EXISTS v1;
      DROP TABLE IF EXISTS t1,t2;
      DROP PROCEDURE IF EXISTS p1;
      SET sql_mode=ORACLE;
      CREATE TABLE t1 (x INT);
      CREATE VIEW v1 AS SELECT x+1 AS a,x+1 AS b FROM t1;
      DELIMITER $$
      CREATE PROCEDURE p1
      AS
        a INT;
        b INT;
      BEGIN
        CREATE TABLE t2 AS SELECT a,b FROM v1;
        SHOW CREATE TABLE t2;
        DROP TABLE t2;
      END;
      $$
      DELIMITER ;
      CALL p1();
      

      ERROR 1166 (42000): Incorrect column name 'b '
      

      Attachments

        Activity

          People

            bar Alexander Barkov
            bar Alexander Barkov
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.