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

Confusing column count in IMPORT TABLESPACE error message

    XMLWordPrintable

    Details

      Description

      When importing into another table with different column count the column counts given in the error message do not match visible columns in the table.

      Note that the tables below have 3 and 4 columns, respectively, but the error message says 6 and 7

      noformat
      MariaDB [test]> ALTER TABLE t2 IMPORT TABLESPACE;
      ERROR 1808 (HY000): Schema mismatch (Number of columns don't match, table has 6 columns but the tablespace meta-data file has 7 columns)
      noformat

      How to reproduce

      noformat
      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (
      id INT NOT NULL,
      i1 INT,
      i2 INT,
      i3 INT,
      PRIMARY KEY (id)
      ) ENGINE=INNODB;

      DROP TABLE IF EXISTS t2;
      CREATE TABLE t2 (
      id INT NOT NULL,
      i1 INT,
      i2 INT,
      PRIMARY KEY (id)
      ) ENGINE=INNODB;

      ALTER TABLE t2 DISCARD TABLESPACE;
      FLUSH TABLES t1 FOR EXPORT;

          1. in other terminal

      cd /var/lib/mysql/test
      cp -vp t1.ibd t2.ibd
      cp -vp t1.cfg t2.cfg
      journalctl -u mariadb.service -f

      ###

      UNLOCK TABLES;
      ALTER TABLE t2 IMPORT TABLESPACE;
      noformat

        Attachments

          Activity

            People

            Assignee:
            kevg Eugene Kosov (Inactive)
            Reporter:
            hholzgra Hartmut Holzgraefe
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.