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

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

          Transition Time In Source Status Execution Times
          Nayuta Yanagisawa (Inactive) made transition -
          Open Confirmed
          11d 20h 16m 1
          Nayuta Yanagisawa (Inactive) made transition -
          Confirmed In Review
          10s 1
          Nayuta Yanagisawa (Inactive) made transition -
          In Review Closed
          20h 34m 1

          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.