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

EXCHANGE PARTITION on view causes ER_CHECK_NO_SUCH_TABLE instead of ER_WRONG_OBJECT

    XMLWordPrintable

Details

    Description

      --source include/have_partition.inc
       
      CREATE TABLE t1 (a INT) PARTITION BY HASH(a);
      CREATE TABLE t2 (a INT);
      CREATE VIEW v AS SELECT * FROM t1;
      ALTER TABLE v EXCHANGE PARTITION p0 WITH TABLE t2;
       
      # Cleanup
      DROP VIEW v;
      DROP TABLE t1, t2;
      

      10.3 3e564d46

      mysqltest: At line 6: query 'ALTER TABLE v EXCHANGE PARTITION p0 WITH TABLE t2' failed: 1177: Can't open table
      

      An error is of course expected, but in other similar situations it would be

      mysqltest: At line 6: query 'ALTER TABLE v PARTITION BY HASH(a)' failed: 1347: 'test.v' is not of type 'BASE TABLE'
      

      ER_CHECK_NO_SUCH_TABLE "Can't open table" is misleading as it hints at table corruption.

      Also reproducible on MySQL 5.7, 8.0.

      Attachments

        Activity

          People

            nayuta-yanagisawa Nayuta Yanagisawa (Inactive)
            elenst Elena Stepanova
            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.